From: Sven Eden Date: Mon, 14 Aug 2017 07:16:16 +0000 (+0200) Subject: Prep v235: Apply upstream fixes (7/10) [src/shared] X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4b274ebf20d54363296f0d28a23129353cda10be;p=elogind.git Prep v235: Apply upstream fixes (7/10) [src/shared] --- 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); diff --git a/src/shared/pager.c b/src/shared/pager.c index 8f3fc133b..2c855bd8f 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -87,7 +87,7 @@ int pager_open(bool no_pager, bool jump_to_end) { if (pipe(fd) < 0) return log_error_errno(errno, "Failed to create pager pipe: %m"); - parent_pid = getpid(); + parent_pid = getpid_cached(); pager_pid = fork(); if (pager_pid < 0) diff --git a/src/shared/udev-util.c b/src/shared/udev-util.c index ed32f0305..f708dcfa1 100644 --- a/src/shared/udev-util.c +++ b/src/shared/udev-util.c @@ -19,7 +19,6 @@ #include -#include "alloc-util.h" #include "fileio.h" #include "log.h" #include "string-util.h"