bus: bus_open_user_systemd() fall back to bus if runtime dir is not set

This commit is contained in:
Kay Sievers
2013-12-01 18:17:21 +01:00
parent 917c03718c
commit 537220d910

View File

@@ -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)