diff --git a/src/dbus-common.c b/src/dbus-common.c index 50daedcf5..a07236998 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 c3499b999..15811a7e5 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 db7cc2f1d..c5abcf674 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 4626acbd3..0aea99e33 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) \