diff options
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r-- | src/libsystemd-bus/bus-util.c | 9 |
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) |