]> err.no Git - systemd/commitdiff
systemctl: fix detection whether the dbus connection is available
authorLennart Poettering <lennart@poettering.net>
Thu, 29 Sep 2011 13:31:53 +0000 (15:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 29 Sep 2011 13:32:10 +0000 (15:32 +0200)
src/systemctl.c

index 848d6a8e4f0d53ad2a9a432d301a95608f210cc7..7af0f73827f05751a8dc71b0bf93664296adc876 100644 (file)
@@ -4989,6 +4989,13 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
                         return 0;
                 }
 
+                if (!bus) {
+                        log_error("Failed to get D-Bus connection: %s", error->message);
+                        return -EIO;
+                }
+
+        } else {
+
                 if (!bus && !avoid_bus()) {
                         log_error("Failed to get D-Bus connection: %s", error->message);
                         return -EIO;