diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-08-14 09:16:16 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-08-14 09:20:58 +0200 |
commit | 4b274ebf20d54363296f0d28a23129353cda10be (patch) | |
tree | 097396d45617d8f579b6125d48629605bc843575 /src/shared/bus-util.c | |
parent | c1480d46a9e8781a15aa5553330a1230afde245b (diff) |
Prep v235: Apply upstream fixes (7/10) [src/shared]
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 634d1394c..2678cc9b0 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -597,28 +597,8 @@ int bus_connect_system_systemd(sd_bus **_bus) { if (geteuid() != 0) return sd_bus_default_system(_bus); - /* If we are root and kdbus is not available, then let's talk - * directly to the system instance, instead of going via the - * bus */ - - r = sd_bus_new(&bus); - if (r < 0) - return r; - - r = sd_bus_set_address(bus, KERNEL_SYSTEM_BUS_ADDRESS); - if (r < 0) - return r; - - bus->bus_client = true; - - r = sd_bus_start(bus); - if (r >= 0) { - *_bus = bus; - bus = NULL; - return 0; - } - - bus = sd_bus_unref(bus); + /* If we are root then let's talk directly to the system + * instance, instead of going via the bus */ r = sd_bus_new(&bus); if (r < 0) @@ -648,28 +628,8 @@ int bus_connect_user_systemd(sd_bus **_bus) { const char *e; int r; - /* Try via kdbus first, and then directly */ - assert(_bus); - r = sd_bus_new(&bus); - if (r < 0) - return r; - - if (asprintf(&bus->address, KERNEL_USER_BUS_ADDRESS_FMT, getuid()) < 0) - return -ENOMEM; - - bus->bus_client = true; - - r = sd_bus_start(bus); - if (r >= 0) { - *_bus = bus; - bus = NULL; - return 0; - } - - bus = sd_bus_unref(bus); - e = secure_getenv("XDG_RUNTIME_DIR"); if (!e) return sd_bus_default_user(_bus); |