chiark / gitweb /
man: document that we don't document .include on purpose
[elogind.git] / src / core / condition.c
index d8d11528eca33a90c59c9527c76cdf1a41960714..c20c0f01e1da6df5ae90ad3b0b6e6872afc1626c 100644 (file)
@@ -22,7 +22,7 @@
 #include "condition.h"
 #include "unit.h"
 
-bool condition_test_list(const char *unit, Condition *first) {
+bool condition_test_list(const char *unit, Condition *first, const char *(*to_string)(ConditionType t)) {
         Condition *c;
         int triggered = -1;
 
@@ -40,7 +40,7 @@ bool condition_test_list(const char *unit, Condition *first) {
                 if (r < 0)
                         log_warning_unit(unit,
                                          "Couldn't determine result for %s=%s%s%s for %s, assuming failed: %s",
-                                         condition_type_to_string(c->type),
+                                         to_string(c->type),
                                          c->trigger ? "|" : "",
                                          c->negate ? "!" : "",
                                          c->parameter,
@@ -49,15 +49,13 @@ bool condition_test_list(const char *unit, Condition *first) {
                 else
                         log_debug_unit(unit,
                                        "%s=%s%s%s %s for %s.",
-                                       condition_type_to_string(c->type),
+                                       to_string(c->type),
                                        c->trigger ? "|" : "",
                                        c->negate ? "!" : "",
                                        c->parameter,
-                                       r > 0 ? "succeeded" : "failed",
+                                       condition_result_to_string(c->result),
                                        unit);
 
-                c->state = r > 0 ? CONDITION_STATE_SUCCEEDED : CONDITION_STATE_FAILED;
-
                 if (!c->trigger && r <= 0)
                         return false;