diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-16 16:20:24 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-16 16:20:24 +0200 |
commit | 5301be81d094129232becb2a087f8db4967d1fc6 (patch) | |
tree | 82c976b410b946dc49fcd3ec0bd0cb45a64c2f2d /dbus-unit.c | |
parent | ed42e037bc93f8f6b54ee7b0b692c1200d2f4903 (diff) |
dbus: expoose unit dependencies
Diffstat (limited to 'dbus-unit.c')
-rw-r--r-- | dbus-unit.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dbus-unit.c b/dbus-unit.c index 0c311ea1a7..e3e1be12ad 100644 --- a/dbus-unit.c +++ b/dbus-unit.c @@ -44,6 +44,25 @@ int bus_unit_append_names(Manager *m, DBusMessageIter *i, const char *property, return 0; } +int bus_unit_append_dependencies(Manager *m, DBusMessageIter *i, const char *property, void *data) { + Unit *u; + Iterator j; + DBusMessageIter sub; + Set *s = data; + + if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub)) + return -ENOMEM; + + SET_FOREACH(u, s, j) + if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &u->meta.id)) + return -ENOMEM; + + if (!dbus_message_iter_close_container(i, &sub)) + return -ENOMEM; + + return 0; +} + int bus_unit_append_description(Manager *m, DBusMessageIter *i, const char *property, void *data) { Unit *u = data; const char *d; |