summaryrefslogtreecommitdiff
path: root/src/timedate/timedated.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-03 18:01:26 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-03 18:02:46 +0100
commite7176abbe818c75c6acd90227a7a84c3e05fee31 (patch)
treef6aabfb7282b1a4e01b80025f4f05f14a727ffcf /src/timedate/timedated.c
parent059d9fbb5a691ced7428cff5ff1da5681cacf6da (diff)
bus: make sd_bus_request_name() and sd_bus_release_name() behave more like other calls
Instead of returning an enum of return codes, make them return error codes like kdbus does internally. Also, document this behaviour so that clients can stick to it. (Also rework bus-control.c to always have to functions for dbus1 vs. kernel implementation of the various calls.)
Diffstat (limited to 'src/timedate/timedated.c')
-rw-r--r--src/timedate/timedated.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index a8261fee38..0641f39551 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -786,17 +786,12 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) {
return r;
}
- r = sd_bus_request_name(bus, "org.freedesktop.timedate1", SD_BUS_NAME_DO_NOT_QUEUE);
+ r = sd_bus_request_name(bus, "org.freedesktop.timedate1", SD_BUS_NAME_REPLACE_EXISTING|SD_BUS_NAME_DO_NOT_QUEUE);
if (r < 0) {
log_error("Failed to register name: %s", strerror(-r));
return r;
}
- if (r != SD_BUS_NAME_PRIMARY_OWNER) {
- log_error("Failed to acquire name.");
- return -EEXIST;
- }
-
r = sd_bus_attach_event(bus, event, 0);
if (r < 0) {
log_error("Failed to attach bus to event loop: %s", strerror(-r));