From fda316373dfbd396fd73b9a3242ab1dbf2a459e8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 11 Jul 2016 10:52:44 +0100 Subject: [PATCH] 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 . Signed-off-by: Simon McVittie --- tools/dbus-update-activation-environment.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/dbus-update-activation-environment.c b/tools/dbus-update-activation-environment.c index 6c53d8e..160ac5d 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", -- 2.8.1