mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
bus: bus_open_user_systemd() fall back to bus if runtime dir is not set
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user