summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-12-01 18:17:21 +0100
committerKay Sievers <kay@vrfy.org>2013-12-01 18:36:53 +0100
commit537220d9102a12aa4a65d5479130ac2cdb323fff (patch)
treeba185b9a0ed29af78c4db87e6bad10a05f574a8a
parent917c03718c98a24dfd2ec089fddd9bec0d307c7d (diff)
bus: bus_open_user_systemd() fall back to bus if runtime dir is not set
-rw-r--r--src/libsystemd-bus/bus-util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 5069aaaaba..bd005262eb 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -477,10 +477,11 @@ int bus_open_user_systemd(sd_bus **_bus) {
assert(_bus);
e = secure_getenv("XDG_RUNTIME_DIR");
- if (e) {
- if (asprintf(&p, "unix:path=%s/systemd/private", e) < 0)
- return -ENOMEM;
- }
+ if (!e)
+ return sd_bus_open_user(_bus);
+
+ if (asprintf(&p, "unix:path=%s/systemd/private", e) < 0)
+ return -ENOMEM;
r = sd_bus_new(&bus);
if (r < 0)