summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/condition.c4
-rw-r--r--src/core/dbus-unit.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/core/condition.c b/src/core/condition.c
index d8d11528ec..8475258679 100644
--- a/src/core/condition.c
+++ b/src/core/condition.c
@@ -53,11 +53,9 @@ bool condition_test_list(const char *unit, Condition *first) {
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;
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 2d1862cfc6..3fa427198e 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -328,10 +328,16 @@ static int property_get_conditions(
return r;
LIST_FOREACH(conditions, c, u->conditions) {
+ int tristate;
+
+ tristate =
+ c->result == CONDITION_UNTESTED ? 0 :
+ c->result == CONDITION_SUCCEEDED ? 1 : -1;
+
r = sd_bus_message_append(reply, "(sbbsi)",
condition_type_to_string(c->type),
c->trigger, c->negate,
- c->parameter, c->state);
+ c->parameter, tristate);
if (r < 0)
return r;