From: Lennart Poettering Date: Thu, 29 Sep 2011 14:00:29 +0000 (+0200) Subject: systemctl: fix error message when no connection to systemd is available X-Git-Tag: v37~31 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f176b5c296ad36119aa2464f9fd738e6da59eeee;p=systemd systemctl: fix error message when no connection to systemd is available --- diff --git a/src/systemctl.c b/src/systemctl.c index 7af0f738..9b54da16 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -4990,14 +4990,16 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError } if (!bus) { - log_error("Failed to get D-Bus connection: %s", error->message); + log_error("Failed to get D-Bus connection: %s", + dbus_error_is_set(error) ? error->message : "No connection to service manager."); return -EIO; } } else { if (!bus && !avoid_bus()) { - log_error("Failed to get D-Bus connection: %s", error->message); + log_error("Failed to get D-Bus connection: %s", + dbus_error_is_set(error) ? error->message : "No connection to service manager."); return -EIO; } }