diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:57:32 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:57:32 +0100 |
commit | 4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f (patch) | |
tree | c7a6228e7151aa74bc8e331694a1e795226550cd /src/systemctl | |
parent | 56f64d95763a799ba4475daf44d8e9f72a1bd474 (diff) |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications".
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 69f157cebb..ffb97df141 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5219,10 +5219,9 @@ static int enable_sysv_units(const char *verb, char **args) { log_info("Executing %s", l); pid = fork(); - if (pid < 0) { - log_error_errno(errno, "Failed to fork: %m"); - return -errno; - } else if (pid == 0) { + if (pid < 0) + return log_error_errno(errno, "Failed to fork: %m"); + else if (pid == 0) { /* Child */ execv(argv[0], (char**) argv); @@ -6952,10 +6951,8 @@ static int reload_with_fallback(sd_bus *bus) { /* Nothing else worked, so let's try signals */ assert(arg_action == ACTION_RELOAD || arg_action == ACTION_REEXEC); - if (kill(1, arg_action == ACTION_RELOAD ? SIGHUP : SIGTERM) < 0) { - log_error_errno(errno, "kill() failed: %m"); - return -errno; - } + if (kill(1, arg_action == ACTION_RELOAD ? SIGHUP : SIGTERM) < 0) + return log_error_errno(errno, "kill() failed: %m"); return 0; } |