s3:net registry import: reduce indentation and untangle assignment from check
authorMichael Adam <obnox@samba.org>
Tue, 26 Jun 2012 11:32:40 +0000 (13:32 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 26 Jun 2012 17:57:19 +0000 (19:57 +0200)
in import_with_precheck_action().

source3/utils/net_registry.c

index 920ddc4fbab90486b5c2677037997fd813ab1ae3..5e0e556c2239de4ee8fe46225a2ea36f4b167eaf 100644 (file)
@@ -1241,13 +1241,18 @@ static int import_with_precheck_action(const char *import_fname,
                .data        = &import_ctx
        };
        int ret = -1;
+       bool precheck_ok;
 
-       if (import_precheck(precheck_fname, parse_options)) {
-               ret = reg_parse_file(import_fname,
-                                    reg_import_adapter(frame, import_callback),
-                                    parse_options);
+       precheck_ok = import_precheck(precheck_fname, parse_options);
+       if (!precheck_ok) {
+               goto done;
        }
 
+       ret = reg_parse_file(import_fname,
+                            reg_import_adapter(frame, import_callback),
+                            parse_options);
+
+done:
        talloc_free(frame);
        return ret;
 }