chiark / gitweb /
condition: fix dumping of conditions
authorMichal Schmidt <mschmidt@redhat.com>
Sun, 3 Apr 2011 16:16:48 +0000 (18:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 3 Apr 2011 20:15:58 +0000 (22:15 +0200)
Several condition types were missing their strings, they were showing as
"(null)" in systemctl dump.
Indentation was missing too.

src/condition.c

index b404b49..5ab77d8 100644 (file)
@@ -199,7 +199,7 @@ void condition_dump(Condition *c, FILE *f, const char *prefix) {
                 prefix = "";
 
         fprintf(f,
-                "%s%s: %s%s%s\n",
+                "%s\t%s: %s%s%s\n",
                 prefix,
                 condition_type_to_string(c->type),
                 c->trigger ? "|" : "",
@@ -215,8 +215,11 @@ void condition_dump_list(Condition *first, FILE *f, const char *prefix) {
 }
 
 static const char* const condition_type_table[_CONDITION_TYPE_MAX] = {
-        [CONDITION_KERNEL_COMMAND_LINE] = "ConditionKernelCommandLine",
         [CONDITION_PATH_EXISTS] = "ConditionPathExists",
+        [CONDITION_PATH_IS_DIRECTORY] = "ConditionPathIsDirectory",
+        [CONDITION_DIRECTORY_NOT_EMPTY] = "ConditionDirectoryNotEmpty",
+        [CONDITION_KERNEL_COMMAND_LINE] = "ConditionKernelCommandLine",
+        [CONDITION_VIRTUALIZATION] = "ConditionVirtualization",
         [CONDITION_NULL] = "ConditionNull"
 };