diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-03-29 16:14:11 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-03-29 16:14:11 +0200 |
commit | 56fbd7187a5af44a90c258fbeb1f17114f226bb3 (patch) | |
tree | 1cbca1b260953e6e1f95fc69bfc0e6af6c5980ff /src/core/dbus.c | |
parent | c75436067f4b392ecf161e123279720dc5c3b33a (diff) | |
download | systemd-56fbd7187a5af44a90c258fbeb1f17114f226bb3.tar.gz |
sd-bus: allow description to be set for system/user busses (#8594)
sd_bus_open/sd_bus_open_system/sd_bus_open_user are convenient, but
don't allow the description to be set. After they return, the bus is
is already started, and sd_bus_set_description() fails with -EBUSY.
It would be possible to allow sd_bus_set_description() to update the
description "live", but messages are already emitted from sd_bus_open
functions, so it's better to allow the description to be set in
sd_bus_open/sd_bus_open_system/sd_bus_open_user.
Fixes message like:
Bus n/a: changing state UNSET → OPENING
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r-- | src/core/dbus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c index eb9ec44f5b..ace6ffa8cf 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -895,9 +895,9 @@ int bus_init_api(Manager *m) { bus = sd_bus_ref(m->system_bus); else { if (MANAGER_IS_SYSTEM(m)) - r = sd_bus_open_system(&bus); + r = sd_bus_open_system_with_description(&bus, "bus-api-system"); else - r = sd_bus_open_user(&bus); + r = sd_bus_open_user_with_description(&bus, "bus-api-user"); if (r < 0) return log_error_errno(r, "Failed to connect to API bus: %m"); @@ -959,7 +959,7 @@ int bus_init_system(Manager *m) { if (MANAGER_IS_SYSTEM(m) && m->api_bus) bus = sd_bus_ref(m->api_bus); else { - r = sd_bus_open_system(&bus); + r = sd_bus_open_system_with_description(&bus, "bus-system"); if (r < 0) return log_error_errno(r, "Failed to connect to system bus: %m"); |