summaryrefslogtreecommitdiff
path: root/src/core/dbus-unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-06 02:27:10 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-06 14:21:10 +0100
commitcc50ef134b4104cae8783a4ca40b1a70247e3ef9 (patch)
tree30cc896be717ca682cdc23a04f58838c7a69976f /src/core/dbus-unit.c
parentb80ba1da1c66f570c10a92a40f54a044fb865739 (diff)
condition: record test state internally and beef it up to be a full enum
Diffstat (limited to 'src/core/dbus-unit.c')
-rw-r--r--src/core/dbus-unit.c8
1 files changed, 7 insertions, 1 deletions
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;