X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fanalyze%2Fanalyze.c;h=715ad73ff9e53ef6866e59aa18f63ef38b0e9467;hb=5b30bef856e89a571df57b7b953e9a1409d9aced;hp=22bf07670ecab41992d741438387bc1ba74156fc;hpb=46e65dcc3a522b5e992e165b5e61d14254026859;p=elogind.git diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 22bf07670..715ad73ff 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -190,10 +190,8 @@ static int bus_parse_unit_info(sd_bus_message *message, struct unit_info *u) { &u->job_id, &u->job_type, &u->job_path); - if (r < 0) { - log_error("Failed to parse message as unit_info."); - return -EIO; - } + if (r < 0) + return bus_log_parse_error(r); return r; } @@ -230,6 +228,9 @@ static int bus_get_unit_property_strv(sd_bus *bus, const char *unit_path, const } } + if (r < 0) + return bus_log_parse_error(r); + return r; } @@ -839,15 +840,13 @@ static int list_dependencies(sd_bus *bus, const char *name) { &reply, "s"); if (r < 0) { - log_error("Failed to parse reply: %s", bus_error_message(&error, -r)); + log_error("Failed to get ID: %s", bus_error_message(&error, -r)); return r; } r = sd_bus_message_read(reply, "s", &id); - if (r < 0) { - log_error("Failed to parse reply."); - return r; - } + if (r < 0) + return bus_log_parse_error(r); times = hashmap_get(unit_times_hashmap, id); @@ -1114,10 +1113,8 @@ static int dump(sd_bus *bus, char **args) { } r = sd_bus_message_read(reply, "s", &text); - if (r < 0) { - log_error("Failed to parse reply"); - return r; - } + if (r < 0) + return bus_log_parse_error(r); fputs(text, stdout); return 0;