summaryrefslogtreecommitdiff
path: root/src/dbus1-generator/dbus1-generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbus1-generator/dbus1-generator.c')
-rw-r--r--src/dbus1-generator/dbus1-generator.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c
index 4980fccc31..25c8e209fd 100644
--- a/src/dbus1-generator/dbus1-generator.c
+++ b/src/dbus1-generator/dbus1-generator.c
@@ -84,7 +84,8 @@ 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=" DEFAULT_SYSTEM_BUS_ADDRESS "\n");
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS=%s\n",
+ is_kdbus_available() ? KERNEL_SYSTEM_BUS_ADDRESS : UNIX_SYSTEM_BUS_ADDRESS);
else if (streq(type, "session")) {
char *run;
@@ -94,8 +95,10 @@ static int create_dbus_files(
return -EINVAL;
}
- fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT "\n",
- getuid(), run);
+ if (is_kdbus_available())
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_ADDRESS_FMT "\n", getuid());
+ else
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS="UNIX_USER_BUS_ADDRESS_FMT "\n", run);
}
}