]> mj.ucw.cz Git - libucw.git/commitdiff
If no config file is specified, pretend loading an empty configuration
authorMartin Mares <mj@ucw.cz>
Sun, 23 Dec 2007 21:08:47 +0000 (22:08 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 23 Dec 2007 21:08:47 +0000 (22:08 +0100)
(i.e., create an empty transaction and commit it immediately).

Otherwise, programs with NULL cf_def_file crash when given `-S'.

lib/conf-input.c

index b890295d99742025c5fecbe69c89544770d6c86d..c5d2527772548911bd3f163b115392e90f2f3035 100644 (file)
@@ -395,6 +395,11 @@ load_default(void)
       else if (cf_load(cf_def_file))
         die("Cannot load default config %s", cf_def_file);
     }
+  else
+    {
+      // We need to create an empty pool
+      cf_journal_commit_transaction(1, cf_journal_new_transaction(1));
+    }
 }
 
 static void