chiark / gitweb /
systemctl: don't hit an assert if we try to reboot and dbus is dead
authorLennart Poettering <lennart@poettering.net>
Fri, 11 Jan 2013 23:00:22 +0000 (00:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Jan 2013 20:24:57 +0000 (21:24 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=889624

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) {