diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-10-27 12:17:02 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-10-27 13:23:55 +0200 |
commit | 8ec6108c0bdb5ab2e05bc20ab41ad6653805fd00 (patch) | |
tree | 65996a67b9c80daca8487090a938e0a9e1031e56 /src | |
parent | systemctl: pretty-print ExtensionImages property (diff) | |
download | systemd-8ec6108c0bdb5ab2e05bc20ab41ad6653805fd00.tar.xz systemd-8ec6108c0bdb5ab2e05bc20ab41ad6653805fd00.zip |
systemctl: small fixes for MountImages pretty printing
Diffstat (limited to 'src')
-rw-r--r-- | src/systemctl/systemctl-show.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 7be2248e99..4446087860 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -1617,11 +1617,13 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m r = sd_bus_message_enter_container(m, 'r', "ssba(ss)"); if (r < 0) - return r; + return bus_log_parse_error(r); + if (r == 0) + break; r = sd_bus_message_read(m, "ssb", &source, &destination, &ignore_enoent); - if (r <= 0) - break; + if (r < 0) + return bus_log_parse_error(r); str = strjoin(ignore_enoent ? "-" : "", source, @@ -1632,27 +1634,25 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m r = sd_bus_message_enter_container(m, 'a', "(ss)"); if (r < 0) - return r; + return bus_log_parse_error(r); while ((r = sd_bus_message_read(m, "(ss)", &partition, &mount_options)) > 0) - if (!strextend_with_separator(&str, ":", partition, ":", mount_options)) + if (!strextend_with_separator(&str, ":", partition, mount_options)) return log_oom(); if (r < 0) - return r; + return bus_log_parse_error(r); if (!strextend_with_separator(&paths, " ", str)) return log_oom(); r = sd_bus_message_exit_container(m); if (r < 0) - return r; + return bus_log_parse_error(r); r = sd_bus_message_exit_container(m); if (r < 0) - return r; + return bus_log_parse_error(r); } - if (r < 0) - return bus_log_parse_error(r); r = sd_bus_message_exit_container(m); if (r < 0) |