diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-04-07 17:41:48 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-04-12 13:43:32 +0200 |
commit | c61b443d32ceea2d0a8c46c1d61a9314f1affa89 (patch) | |
tree | 66138efed9fc5f356d4df55b0cb797b10978da26 /src/systemctl | |
parent | cc7cb0ca905157606d8f2827a813ca028d474125 (diff) |
systemctl: add error message when we get unexpected event from waitid()
We should log about everything we don't expect.
Also, add a comment for one case were we do not log, on purpose, and make it
use a separate error code.
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index d3e9ccfbd5..7c259ba06f 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5340,9 +5340,11 @@ static int enable_sysv_units(const char *verb, char **args) { } } else if (status.si_status != 0) - return -EINVAL; - } else + return -EBADE; /* We don't warn here, under the assumption the script already showed an explanation */ + } else { + log_error("Unexpected waitid() result."); return -EPROTO; + } if (found_native) continue; @@ -5413,8 +5415,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) { if (r < 0) return r; - /* If the operation was fully executed by the SysV compat, - * let's finish early */ + /* If the operation was fully executed by the SysV compat, let's finish early */ if (strv_isempty(names)) return 0; |