summaryrefslogtreecommitdiff
path: root/src/dbus-unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-31 18:28:02 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-31 18:28:02 +0200
commita43757462acaffa902417a9876486763d0b7ed58 (patch)
tree25b7bec4cdea2c75e977e5bb825789422764e9ea /src/dbus-unit.c
parent07672f492ef085a9143ce3535700c0d4e83173de (diff)
dbus: export unit file state
Diffstat (limited to 'src/dbus-unit.c')
-rw-r--r--src/dbus-unit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dbus-unit.c b/src/dbus-unit.c
index bf240f97d4..b110e33174 100644
--- a/src/dbus-unit.c
+++ b/src/dbus-unit.c
@@ -145,6 +145,22 @@ int bus_unit_append_sub_state(DBusMessageIter *i, const char *property, void *da
return 0;
}
+int bus_unit_append_file_state(DBusMessageIter *i, const char *property, void *data) {
+ Unit *u = data;
+ const char *state;
+
+ assert(i);
+ assert(property);
+ assert(u);
+
+ state = strempty(unit_file_state_to_string(unit_get_unit_file_state(u)));
+
+ if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &state))
+ return -ENOMEM;
+
+ return 0;
+}
+
int bus_unit_append_can_start(DBusMessageIter *i, const char *property, void *data) {
Unit *u = data;
dbus_bool_t b;