diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-05 04:15:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-05 04:15:39 +0200 |
commit | 917b5dc7075a15bded4948efba8e686dba4509f8 (patch) | |
tree | ede8ff56bbd196da3c124f71a242d9bc5c31ce71 /src/journal | |
parent | 7286037fd438e93137571fa68a741cc894d8e549 (diff) |
bus: add convenience functions for constructing and sending method calls/signals in one call
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journal-gatewayd.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c index 133d0ae478..a633638f80 100644 --- a/src/journal/journal-gatewayd.c +++ b/src/journal/journal-gatewayd.c @@ -743,7 +743,7 @@ static int request_handler_file( } static int get_virtualization(char **v) { - _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_bus_unref_ sd_bus *bus = NULL; const char *t; char *b; @@ -753,21 +753,17 @@ static int get_virtualization(char **v) { if (r < 0) return r; - r = sd_bus_message_new_method_call( + r = sd_bus_call_method( bus, "org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.DBus.Properties", "Get", - &m); - if (r < 0) - return r; - - r = sd_bus_message_append(m, "ss", "org.freedesktop.systemd1.Manager", "Virtualization"); - if (r < 0) - return r; - - r = sd_bus_send_with_reply_and_block(bus, m, 0, NULL, &reply); + NULL, + &reply, + "ss", + "org.freedesktop.systemd1.Manager", + "Virtualization"); if (r < 0) return r; |