mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 13:41:31 +00:00
systemctl: cat: fix error handling
- correctly check for local vs. remote transport
- return after receiving error from expand_names()
(cherry picked from commit 3e7eed8497)
Conflicts:
src/systemctl/systemctl.c
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
795fcf13d2
commit
b4b97da010
@@ -4544,14 +4544,16 @@ static int cat(sd_bus *bus, char **args) {
|
||||
assert(bus);
|
||||
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;
|
||||
}
|
||||
|
||||
r = expand_names(bus, args + 1, NULL, &names);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
log_error("Failed to expand names: %s", strerror(-r));
|
||||
return r;
|
||||
}
|
||||
|
||||
pager_open_if_enabled();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user