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.
This commit is contained in:
Lennart Poettering
2017-02-09 16:13:07 +01:00
parent 4dae8ae6df
commit f9e0eefc7c
11 changed files with 74 additions and 39 deletions
+3 -1
View File
@@ -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);