summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-09-29 15:31:53 +0200
committerLennart Poettering <lennart@poettering.net>2011-09-29 15:32:10 +0200
commit8185a5090a34531b9ef0a65ed3e948e7b6839754 (patch)
tree3d28d73f72ac1516e126d7993746d1f47d9eb983
parent652eb44a7f7b85b8cea0bbf89a8e900a2df2199b (diff)
systemctl: fix detection whether the dbus connection is available
-rw-r--r--src/systemctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 848d6a8e4f..7af0f73827 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;