chiark / gitweb /
systemctl: don't hit an assert if we try to reboot and dbus is dead
[elogind.git] / src / systemctl / systemctl.c
index 0def1a2f5517b2ccc442f6838d3ee2d8908a1795..bfa4d45fc2d8c5ed7ad479314c200a9cef73c2ba 100644 (file)
@@ -1738,6 +1738,9 @@ static int reboot_with_logind(DBusConnection *bus, enum action a) {
         const char *method;
         dbus_bool_t interactive = true;
 
+        if (!bus)
+                return -EIO;
+
         polkit_agent_open_if_enabled();
 
         switch (a) {