diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-14 15:11:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-14 15:11:07 +0200 |
commit | 67f3c40265471056d1e532c6d6e36a521b0a780a (patch) | |
tree | 5ad9713f97611ca2d3b665390546ee0fa2b93db4 /src/shared/dbus-common.c | |
parent | 73836c5c430f48838fec2606b1729dda371edd2d (diff) |
systemctl: show unit name when a job fails
https://bugzilla.redhat.com/show_bug.cgi?id=845028
https://bugzilla.redhat.com/show_bug.cgi?id=846483
Diffstat (limited to 'src/shared/dbus-common.c')
-rw-r--r-- | src/shared/dbus-common.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c index bcbef77b53..b8229bd663 100644 --- a/src/shared/dbus-common.c +++ b/src/shared/dbus-common.c @@ -1253,14 +1253,16 @@ bool bus_error_is_no_service(const DBusError *error) { return startswith(error->name, "org.freedesktop.DBus.Error.Spawn."); } -int bus_method_call_with_reply(DBusConnection *bus, - const char *destination, - const char *path, - const char *interface, - const char *method, - DBusMessage **return_reply, - DBusError *return_error, - int first_arg_type, ...) { +int bus_method_call_with_reply( + DBusConnection *bus, + const char *destination, + const char *path, + const char *interface, + const char *method, + DBusMessage **return_reply, + DBusError *return_error, + int first_arg_type, ...) { + DBusError error; DBusMessage *m, *reply; va_list ap; @@ -1287,6 +1289,7 @@ int bus_method_call_with_reply(DBusConnection *bus, if (!reply) { if (!return_error) log_error("Failed to issue method call: %s", bus_error_message(&error)); + if (bus_error_is_no_service(&error)) r = -ENOENT; else if (dbus_error_has_name(&error, DBUS_ERROR_ACCESS_DENIED)) |