From: Zbigniew Jędrzejewski-Szmek Date: Thu, 8 Mar 2018 09:57:44 +0000 (+0100) Subject: systemctl: propagate the error from kexec X-Git-Tag: v239~532^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df685d5784e0cfdd89b6153bde886b071afff388;p=thirdparty%2Fsystemd.git systemctl: propagate the error from kexec --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index e00cbb2b125..3be01321b6c 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3524,7 +3524,6 @@ static int load_kexec_kernel(void) { if (r < 0) return r; if (r == 0) { - const char* const args[] = { KEXEC, "--load", kernel, @@ -3537,7 +3536,13 @@ static int load_kexec_kernel(void) { _exit(EXIT_FAILURE); } - return wait_for_terminate_and_check("kexec", pid, WAIT_LOG); + r = wait_for_terminate_and_check("kexec", pid, WAIT_LOG); + if (r < 0) + return r; + if (r > 0) + /* Command failed */ + return -EPROTO; + return 0; } static int set_exit_code(uint8_t code) {