[systemd-commits] src/libsystemd-bus
Kay Sievers
kay at kemper.freedesktop.org
Sun Dec 1 09:37:07 PST 2013
src/libsystemd-bus/bus-util.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 537220d9102a12aa4a65d5479130ac2cdb323fff
Author: Kay Sievers <kay at vrfy.org>
Date: Sun Dec 1 18:17:21 2013 +0100
bus: bus_open_user_systemd() fall back to bus if runtime dir is not set
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 5069aaa..bd00526 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)
More information about the systemd-commits
mailing list