chiark / gitweb /
Prep v235: Apply upstream fixes (7/10) [src/shared]
authorSven Eden <yamakuzure@gmx.net>
Mon, 14 Aug 2017 07:16:16 +0000 (09:16 +0200)
committerSven Eden <yamakuzure@gmx.net>
Mon, 14 Aug 2017 07:20:58 +0000 (09:20 +0200)
src/shared/bus-util.c
src/shared/pager.c
src/shared/udev-util.c

index 634d1394c5d499678a735f86e87be51357d1d882..2678cc9b086f22809247a55c9edfc533124ffe9c 100644 (file)
@@ -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);
index 8f3fc133ba29dab4899ace53d5cbe1c145e8bb99..2c855bd8f0c1b7ff8987a8342b93c6168558ae47 100644 (file)
@@ -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)
index ed32f0305a8ee8c00d62ea838b4b5e322f0cef0c..f708dcfa146371fa8acd6b38fca123c89d9d0f11 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <string.h>
 
-#include "alloc-util.h"
 #include "fileio.h"
 #include "log.h"
 #include "string-util.h"