summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-30 16:12:46 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-02 19:45:47 -0500
commitab9001a1e3dc6e60d0cdf53363dc5d18dcc382fd (patch)
treecc00815e489ca4cf52aa8264491b9b5c3b6cbbd2 /src/libsystemd-bus/sd-bus.c
parentda13d4d20f8ca12e86863abbae5ed47bca936828 (diff)
Move bus path definitions to def.h
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 44ab071c47..61dc0e56a8 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -34,6 +34,7 @@
#include "strv.h"
#include "set.h"
#include "missing.h"
+#include "def.h"
#include "sd-bus.h"
#include "bus-internal.h"
@@ -1047,12 +1048,7 @@ _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
-
+ r = sd_bus_set_address(b, DEFAULT_SYSTEM_BUS_PATH);
if (r < 0)
goto fail;
@@ -1103,13 +1099,13 @@ _public_ int sd_bus_open_user(sd_bus **ret) {
}
#ifdef ENABLE_KDBUS
- asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus;unix:path=%s/bus", (unsigned long) getuid(), ee);
+ asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, (unsigned long) getuid(), ee);
#else
- b->address = strjoin("unix:path=", ee, "/bus", NULL);
+ asprintf(&b->address, UNIX_USER_BUS_FMT, (unsigned long) getuid());
#endif
} else {
#ifdef ENABLE_KDBUS
- asprintf(&b->address, "kernel:path=/dev/kdbus/%lu-user/bus", (unsigned long) getuid());
+ asprintf(&b->address, KERNEL_USER_BUS_FMT, (unsigned long) getuid());
#else
return -ECONNREFUSED;
#endif