systemctl: fix detection whether the dbus connection is available

This commit is contained in:
Lennart Poettering 2011-09-29 15:31:53 +02:00
parent 652eb44a7f
commit 8185a5090a

View File

@ -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;