1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00

systemctl: propagate the error from kexec

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-08 10:57:44 +01:00
parent cd086a014b
commit df685d5784

View File

@ -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) {