diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/manager.c | 3 | ||||
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 7de0b26811..badf19e954 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -414,6 +414,7 @@ static int manager_setup_kdbus(Manager *m) { assert(m); +#ifdef ENABLE_KDBUS if (m->kdbus_fd >= 0) return 0; @@ -428,6 +429,8 @@ static int manager_setup_kdbus(Manager *m) { } log_info("Successfully set up kdbus on %s", p); +#endif + return 0; } diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index e224be7056..1244ec2f6d 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -993,7 +993,11 @@ _public_ int sd_bus_open_system(sd_bus **ret) { if (e) r = sd_bus_set_address(b, e); else +#ifdef ENABLE_KDBUS r = sd_bus_set_address(b, "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket"); +#else + r = sd_bus_set_address(b, "unix:path=/run/dbus/system_bus_socket"); +#endif if (r < 0) goto fail; @@ -1035,13 +1039,22 @@ _public_ int sd_bus_open_user(sd_bus **ret) { ee = bus_address_escape(e); if (!ee) { - r = -ENOENT; + r = -ENOMEM; goto fail; } +#ifdef ENABLE_KDBUS asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus;unix:path=%s/bus", (unsigned long) getuid(), ee); - } else +#else + b->address = strjoin("unix:path=", ee, "/bus", NULL); +#endif + } else { +#ifdef ENABLE_KDBUS asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus", (unsigned long) getuid()); +#else + return -ECONNREFUSED; +#endif + } if (!b->address) { r = -ENOMEM; |