summaryrefslogtreecommitdiff
path: root/src/dbus1-generator
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-01-26 17:51:53 +0100
committerKay Sievers <kay@vrfy.org>2014-01-26 18:09:24 +0100
commit62cfb98addf80c25a9ed12683e73859173c65e97 (patch)
tree211db11eb66611adc445411c315d08fe8f1f2f48 /src/dbus1-generator
parent9f70075586839e8f1c097874fea2223a3d76230c (diff)
dbus1-generator: use XDG_RUNTIME_DIR instead of /run/user/%lu/
Diffstat (limited to 'src/dbus1-generator')
-rw-r--r--src/dbus1-generator/dbus1-generator.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c
index 1c24b3ad63..b1c94c2352 100644
--- a/src/dbus1-generator/dbus1-generator.c
+++ b/src/dbus1-generator/dbus1-generator.c
@@ -84,10 +84,19 @@ static int create_dbus_files(
fprintf(f, "Environment=DBUS_STARTER_BUS_TYPE=%s\n", type);
if (streq(type, "system"))
- fprintf(f, "Environment=DBUS_STARTER_ADDRESS=kernel:path=/dev/kdbus/0-system\n");
- else if (streq(type, "session"))
- fprintf(f, "Environment=DBUS_STARTER_ADDRESS=kernel:path=/dev/kdbus/%lu-user;unix:path=/run/user/%lu/bus\n",
- (unsigned long) getuid(), (unsigned long) getuid());
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS=" DEFAULT_SYSTEM_BUS_PATH "\n");
+ else if (streq(type, "session")) {
+ char *run;
+
+ run = getenv("XDG_RUNTIME_DIR");
+ if (!run) {
+ log_error("XDG_RUNTIME_DIR not set.");
+ return -EINVAL;
+ }
+
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT "\n",
+ (unsigned long) getuid(), run);
+ }
}
fflush(f);