From: Lennart Poettering Date: Fri, 1 Mar 2019 16:48:31 +0000 (+0100) Subject: systemctl: let's FORK_WAIT where we can X-Git-Tag: v242-rc1~192^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c943e95f892c62f9bded88de219bcf3c80cdc3d4;p=thirdparty%2Fsystemd.git systemctl: let's FORK_WAIT where we can --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 6a4e73dee4a..0b31a4c9da8 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3569,7 +3569,7 @@ static int load_kexec_kernel(void) { if (arg_dry_run) return 0; - r = safe_fork("(kexec)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_RLIMIT_NOFILE_SAFE|FORK_LOG, &pid); + r = safe_fork("(kexec)", FORK_WAIT|FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_RLIMIT_NOFILE_SAFE|FORK_LOG, &pid); if (r < 0) return r; if (r == 0) { @@ -3578,19 +3578,14 @@ static int load_kexec_kernel(void) { "--load", kernel, "--append", options, initrd ? "--initrd" : NULL, initrd, - NULL }; + NULL + }; /* Child */ execv(args[0], (char * const *) args); _exit(EXIT_FAILURE); } - r = wait_for_terminate_and_check("kexec", pid, WAIT_LOG); - if (r < 0) - return r; - if (r > 0) - /* Command failed */ - return -EPROTO; return 0; }