diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-16 06:10:04 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-16 06:15:02 +0200 |
commit | 40ca29a1370379d43e44c0ed425eecc7218dcbca (patch) | |
tree | 39cde46c8166bd79471b0111251693edddfae3c4 /src/libsystemd-bus/test-bus-chat.c | |
parent | 7a37d62501c97eb3b48a418ef764d0308e0c3fb9 (diff) |
timedated: use libsystemd-bus instead of libdbus for bus communication
Among other things this also adds a few things necessary for the change:
- Considerably more powerful error returning APIs in libsystemd-bus
- Adapter for connecting an sd_bus to an sd_event
- As I reworked the PolicyKit logic to the new library I also made it
asynchronous, so that PolicyKit requests of one user cannot block out
another user anymore.
- We always use the macro names for common bus error. That way it is
harder to mistype them since the compiler will notice
Diffstat (limited to 'src/libsystemd-bus/test-bus-chat.c')
-rw-r--r-- | src/libsystemd-bus/test-bus-chat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-bus/test-bus-chat.c b/src/libsystemd-bus/test-bus-chat.c index aefe8f1b3b..efc19c68b3 100644 --- a/src/libsystemd-bus/test-bus-chat.c +++ b/src/libsystemd-bus/test-bus-chat.c @@ -34,6 +34,7 @@ #include "bus-error.h" #include "bus-match.h" #include "bus-internal.h" +#include "bus-util.h" static int match_callback(sd_bus *bus, sd_bus_message *m, void *userdata) { log_info("Match triggered! interface=%s member=%s", strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m))); @@ -243,7 +244,7 @@ static int server(sd_bus *bus) { r = sd_bus_reply_method_error( bus, m, - &SD_BUS_ERROR_MAKE("org.freedesktop.DBus.Error.UnknownMethod", "Unknown method.")); + &SD_BUS_ERROR_MAKE(SD_BUS_ERROR_UNKNOWN_METHOD, "Unknown method.")); if (r < 0) { log_error("Failed to send reply: %s", strerror(-r)); goto fail; @@ -359,7 +360,7 @@ finish: static int quit_callback(sd_bus *b, sd_bus_message *m, void *userdata) { bool *x = userdata; - log_error("Quit callback: %s", strerror(-bus_message_to_errno(m))); + log_error("Quit callback: %s", strerror(sd_bus_message_get_errno(m))); *x = 1; return 1; |