diff options
Diffstat (limited to 'src/hostname')
-rw-r--r-- | src/hostname/hostnamed.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index e98bd42f2d..9082966057 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -574,17 +574,12 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) { return r; } - r = sd_bus_request_name(bus, "org.freedesktop.hostname1", SD_BUS_NAME_DO_NOT_QUEUE); + r = sd_bus_request_name(bus, "org.freedesktop.hostname1", 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)); |