chiark / gitweb /
bus: rework sd_bus_list_names() to return two lists for acquired and activatable...
[elogind.git] / src / libsystemd-bus / bus-util.c
index 5069aaaaba87c809d838a5a1721639181e313fe5..1945f47994d8bdf67dc7341de7bffa8cc8332118 100644 (file)
@@ -66,7 +66,7 @@ int bus_async_unregister_and_quit(sd_event *e, sd_bus *bus, const char *name) {
         if (r < 0)
                 return r;
 
-        if (r != SD_BUS_NAME_RELEASED)
+        if (r != BUS_NAME_RELEASED)
                 return -EIO;
 
         return 0;
@@ -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)