dbus: export ControlGroupPersistent field on the bus again

This commit is contained in:
Lennart Poettering 2012-01-21 01:47:53 +01:00
parent c7eb4b85c3
commit aa001cd699
4 changed files with 19 additions and 1 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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, }
};

View File

@ -94,6 +94,7 @@
" <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"ControlGroupModify\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"ControlGroupPersistent\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"PrivateNetwork\" type=\"b\" access=\"read\"/>\n"
#define BUS_EXEC_COMMAND_INTERFACE(name) \