From: Lennart Poettering Date: Sat, 21 Jan 2012 00:47:53 +0000 (+0100) Subject: dbus: export ControlGroupPersistent field on the bus again X-Git-Tag: v39~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa001cd699a62a5a7a9b8a86c403bfe35fb73aa4;p=systemd dbus: export ControlGroupPersistent field on the bus again --- diff --git a/src/dbus-common.c b/src/dbus-common.c index 50daedcf..a0723699 100644 --- a/src/dbus-common.c +++ b/src/dbus-common.c @@ -533,6 +533,22 @@ int bus_property_append_bool(DBusMessageIter *i, const char *property, void *dat return 0; } +int bus_property_append_tristate_false(DBusMessageIter *i, const char *property, void *data) { + int *b = data; + dbus_bool_t db; + + assert(i); + assert(property); + assert(b); + + db = *b > 0; + + if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &db)) + return -ENOMEM; + + return 0; +} + int bus_property_append_uint64(DBusMessageIter *i, const char *property, void *data) { assert(i); assert(property); diff --git a/src/dbus-common.h b/src/dbus-common.h index c3499b99..15811a7e 100644 --- a/src/dbus-common.h +++ b/src/dbus-common.h @@ -128,6 +128,7 @@ DBusHandlerResult bus_default_message_handler( int bus_property_append_string(DBusMessageIter *i, const char *property, void *data); int bus_property_append_strv(DBusMessageIter *i, const char *property, void *data); int bus_property_append_bool(DBusMessageIter *i, const char *property, void *data); +int bus_property_append_tristate_false(DBusMessageIter *i, const char *property, void *data); int bus_property_append_int32(DBusMessageIter *i, const char *property, void *data); int bus_property_append_uint32(DBusMessageIter *i, const char *property, void *data); int bus_property_append_uint64(DBusMessageIter *i, const char *property, void *data); diff --git a/src/dbus-execute.c b/src/dbus-execute.c index db7cc2f1..c5abcf67 100644 --- a/src/dbus-execute.c +++ b/src/dbus-execute.c @@ -416,6 +416,6 @@ const BusProperty bus_exec_context_properties[] = { { "KillSignal", bus_property_append_int, "i", offsetof(ExecContext, kill_signal) }, { "UtmpIdentifier", bus_property_append_string, "s", offsetof(ExecContext, utmp_id), true }, { "ControlGroupModify", bus_property_append_bool, "b", offsetof(ExecContext, control_group_modify) }, -/* FIXME{ "ControlGroupPersistent", bus_property_append_bool, "b", offsetof(ExecContext, control_group_persistent) },*/ + { "ControlGroupPersistent", bus_property_append_tristate_false, "b", offsetof(ExecContext, control_group_persistent) }, { NULL, } }; diff --git a/src/dbus-execute.h b/src/dbus-execute.h index 4626acbd..0aea99e3 100644 --- a/src/dbus-execute.h +++ b/src/dbus-execute.h @@ -94,6 +94,7 @@ " \n" \ " \n" \ " \n" \ + " \n" \ " \n" #define BUS_EXEC_COMMAND_INTERFACE(name) \