diff options
author | Ivan Shapovalov <intelfx100@gmail.com> | 2015-02-05 01:56:58 +0300 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-02-04 20:10:27 -0500 |
commit | 3e7eed8497098d1b09fd4ae1260c5242e16a8127 (patch) | |
tree | 8f0ea1f0aff44b97bd72f00050fcf1739beda1f8 /src | |
parent | b5e6a600327d4e92c9fe62b9d51648a9d459871e (diff) |
systemctl: cat: fix error handling
- correctly check for local vs. remote transport
- return after receiving error from expand_names()
Diffstat (limited to 'src')
-rw-r--r-- | src/systemctl/systemctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 083b6180e3..567b467bae 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -4594,8 +4594,8 @@ static int cat(sd_bus *bus, char **args) { assert(args); - if (arg_host) { - log_error("Option --host cannot be used with 'cat'"); + if (arg_transport != BUS_TRANSPORT_LOCAL) { + log_error("Cannot remotely cat units"); return -EINVAL; } @@ -4605,7 +4605,7 @@ static int cat(sd_bus *bus, char **args) { r = expand_names(bus, args + 1, NULL, &names); if (r < 0) - log_error_errno(r, "Failed to expand names: %m"); + return log_error_errno(r, "Failed to expand names: %m"); avoid_bus_cache = !bus || avoid_bus(); |