From 8185a5090a34531b9ef0a65ed3e948e7b6839754 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 29 Sep 2011 15:31:53 +0200 Subject: [PATCH] systemctl: fix detection whether the dbus connection is available --- src/systemctl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/systemctl.c b/src/systemctl.c index 848d6a8e4..7af0f7382 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;