diff options
author | Simon McVittie <smcv@debian.org> | 2016-07-11 10:52:44 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2016-08-12 09:50:00 +0100 |
commit | 4729b7a5f44b9531afac739625956f2fafeb0b2c (patch) | |
tree | 382ab4777a3c9ac3207935f462ca4549ca921edc | |
parent | 9e79a8ff8ca7b5ff793d22ab21bdb74d4f0add04 (diff) | |
download | dbus-4729b7a5f44b9531afac739625956f2fafeb0b2c.tar.gz |
update-activation-environment: produce better diagnostics on error
If dbus-daemon or systemd replied to our method call with an error,
we would report it as "invalid arguments" instead of the true error
name and message.
Same root cause as <https://bugs.freedesktop.org/show_bug.cgi?id=96653>.
Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r-- | tools/dbus-update-activation-environment.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/dbus-update-activation-environment.c b/tools/dbus-update-activation-environment.c index 6c53d8e2..160ac5d0 100644 --- a/tools/dbus-update-activation-environment.c +++ b/tools/dbus-update-activation-environment.c @@ -378,7 +378,8 @@ next: exit (EX_UNAVAILABLE); } - if (!dbus_message_get_args (msg, &error, DBUS_TYPE_INVALID)) + if (dbus_set_error_from_message (&error, msg) || + !dbus_message_get_args (msg, &error, DBUS_TYPE_INVALID)) { fprintf (stderr, "%s: error from dbus-daemon: %s: %s\n", @@ -402,7 +403,8 @@ next: "%s: warning: error sending to systemd: %s: %s\n", PROGNAME, error.name, error.message); } - else if (!dbus_message_get_args (msg, &error, DBUS_TYPE_INVALID)) + else if (dbus_set_error_from_message (&error, msg) || + !dbus_message_get_args (msg, &error, DBUS_TYPE_INVALID)) { fprintf (stderr, "%s: warning: error from systemd: %s: %s\n", |