summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-08 17:59:58 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-09 16:13:07 +0100
commitf9e0eefc7cd0b9cbcdcaf7ba5d79a46d1b94b25a (patch)
treeae4eac72db37fe48202a9a1d7a622427e5987552 /src/run
parent4dae8ae6df4bc2469532db74bf906aebff527d9e (diff)
tree-wide: make bus_map_all_properties return a proper sd_bus_error
And then show it, to make things a bit friendlier to the user if we fail acquiring some props. In fact, this fixes a number of actual bugs, where we used an error structure for output that we actually never got an error in.
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 08f7e12336..f8257abc93 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -818,16 +818,18 @@ static int run_context_update(RunContext *c, const char *path) {
{}
};
+ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
int r;
r = bus_map_all_properties(c->bus,
"org.freedesktop.systemd1",
path,
map,
+ &error,
c);
if (r < 0) {
sd_event_exit(c->event, EXIT_FAILURE);
- return log_error_errno(r, "Failed to query unit state: %m");
+ return log_error_errno(r, "Failed to query unit state: %s", bus_error_message(&error, r));
}
run_context_check_done(c);