diff options
Diffstat (limited to 'src')
-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; |