1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

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; return 0;
} }
if (!bus) {
log_error("Failed to get D-Bus connection: %s", error->message);
return -EIO;
}
} else {
if (!bus && !avoid_bus()) { if (!bus && !avoid_bus()) {
log_error("Failed to get D-Bus connection: %s", error->message); log_error("Failed to get D-Bus connection: %s", error->message);
return -EIO; return -EIO;