From: Lennart Poettering Date: Thu, 29 Sep 2011 13:31:53 +0000 (+0200) Subject: systemctl: fix detection whether the dbus connection is available X-Git-Tag: v37~32 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8185a5090a34531b9ef0a65ed3e948e7b6839754;p=systemd systemctl: fix detection whether the dbus connection is available --- diff --git a/src/systemctl.c b/src/systemctl.c index 848d6a8e..7af0f738 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -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;