Parse options (and open the database) before starting transactions
authorAndrew Bartlett <abartlet@samba.org>
Thu, 18 Dec 2008 03:31:52 +0000 (14:31 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 Dec 2008 03:36:20 +0000 (14:36 +1100)
source4/lib/ldb/tools/ldbmodify.c

index 0288e4e6885bb197155d37bbbbc32bef16df4f10..d73937cea42f6eeb65003c698d2c0eabded1e703 100644 (file)
@@ -91,13 +91,13 @@ int main(int argc, const char **argv)
 
        ldb = ldb_init(NULL, NULL);
 
 
        ldb = ldb_init(NULL, NULL);
 
+       options = ldb_cmdline_process(ldb, argc, argv, usage);
+
        if (ldb_transaction_start(ldb) != 0) {
                printf("Failed to start transaction: %s\n", ldb_errstring(ldb));
                exit(1);
        }
 
        if (ldb_transaction_start(ldb) != 0) {
                printf("Failed to start transaction: %s\n", ldb_errstring(ldb));
                exit(1);
        }
 
-       options = ldb_cmdline_process(ldb, argc, argv, usage);
-
        if (options->argc == 0) {
                ret = process_file(ldb, stdin, &count);
        } else {
        if (options->argc == 0) {
                ret = process_file(ldb, stdin, &count);
        } else {