From e7176abbe818c75c6acd90227a7a84c3e05fee31 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Dec 2013 18:01:26 +0100 Subject: 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.) --- src/core/dbus.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/core/dbus.c') diff --git a/src/core/dbus.c b/src/core/dbus.c index 7d7c6cbdd..cda1c5d5b 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -819,17 +819,12 @@ static int bus_setup_api(Manager *m, sd_bus *bus) { * after the new connection is set up and the name installed * to allow clients to synchronously wait for reexecution to * finish */ - r = sd_bus_request_name(bus,"org.freedesktop.systemd1", SD_BUS_NAME_ALLOW_REPLACEMENT|SD_BUS_NAME_REPLACE_EXISTING); + r = sd_bus_request_name(bus,"org.freedesktop.systemd1", 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; - } - bus_list_names(m, bus); log_debug("Successfully connected to API bus."); -- cgit v1.2.3