summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-21 01:47:53 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-21 01:47:53 +0100
commitaa001cd699a62a5a7a9b8a86c403bfe35fb73aa4 (patch)
tree9d821287e27813b9a84452e92a3c3087fd06b4d4
parentc7eb4b85c3fad15a6b4d19a9ef084813812db0bb (diff)
dbus: export ControlGroupPersistent field on the bus again
-rw-r--r--src/dbus-common.c16
-rw-r--r--src/dbus-common.h1
-rw-r--r--src/dbus-execute.c2
-rw-r--r--src/dbus-execute.h1
4 files changed, 19 insertions, 1 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 50daedcf58..a072369988 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 c3499b999f..15811a7e50 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 db7cc2f1da..c5abcf674a 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 4626acbd31..0aea99e333 100644
--- a/src/dbus-execute.h
+++ b/src/dbus-execute.h
@@ -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) \