diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-09-29 15:31:53 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-09-29 15:32:10 +0200 |
commit | 8185a5090a34531b9ef0a65ed3e948e7b6839754 (patch) | |
tree | 3d28d73f72ac1516e126d7993746d1f47d9eb983 | |
parent | 652eb44a7f7b85b8cea0bbf89a8e900a2df2199b (diff) |
systemctl: fix detection whether the dbus connection is available
-rw-r--r-- | src/systemctl.c | 7 |
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; |