summaryrefslogtreecommitdiff
path: root/src/dbus-swap.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-03 04:47:32 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-03 05:06:04 +0100
commite1770af8122a74ee21036e16976cac3f223fe0b2 (patch)
tree474bb3a2cc25bf2aa98361329ef2a60c9c79bbd6 /src/dbus-swap.c
parent067d72c9fe698d305a07db17fc5b328e4a17cc8f (diff)
swap: replace failure boolean by result enum
Diffstat (limited to 'src/dbus-swap.c')
-rw-r--r--src/dbus-swap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dbus-swap.c b/src/dbus-swap.c
index 5ed33b50b4..09cd1e8b9c 100644
--- a/src/dbus-swap.c
+++ b/src/dbus-swap.c
@@ -36,6 +36,7 @@
BUS_EXEC_COMMAND_INTERFACE("ExecDeactivate") \
BUS_EXEC_CONTEXT_INTERFACE \
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
+ " <property name=\"Result\" type=\"s\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
@@ -59,7 +60,8 @@ const char bus_swap_invalidating_properties[] =
"Priority\0"
"ExecActivate\0"
"ExecDeactivate\0"
- "ControlPID\0";
+ "ControlPID\0"
+ "Result\0";
static int bus_swap_append_priority(DBusMessageIter *i, const char *property, void *data) {
Swap *s = data;
@@ -84,12 +86,15 @@ static int bus_swap_append_priority(DBusMessageIter *i, const char *property, vo
return 0;
}
+static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_swap_append_swap_result, swap_result, SwapResult);
+
static const BusProperty bus_swap_properties[] = {
{ "What", bus_property_append_string, "s", offsetof(Swap, what), true },
{ "Priority", bus_swap_append_priority, "i", 0 },
BUS_EXEC_COMMAND_PROPERTY("ExecActivate", offsetof(Swap, exec_command[SWAP_EXEC_ACTIVATE]), false),
BUS_EXEC_COMMAND_PROPERTY("ExecDeactivate", offsetof(Swap, exec_command[SWAP_EXEC_DEACTIVATE]), false),
{ "ControlPID", bus_property_append_pid, "u", offsetof(Swap, control_pid) },
+ { "Result", bus_swap_append_swap_result,"s", offsetof(Swap, result) },
{ NULL, }
};