- if (pid < 0) {
- log_error("Could not fork: %m. Falling back to reboot.");
- cmd = RB_AUTOBOOT;
- } else if (pid > 0) {
- waitpid(pid, NULL, 0);
- log_warning("Failed %s -e -x -f. Falling back to reboot", KEXEC_BINARY_PATH);
- cmd = RB_AUTOBOOT;
+ if (pid < 0)
+ log_error("Could not fork: %m. Falling back to normal reboot.");
+ else if (pid > 0) {
+ wait_for_terminate_and_warn("kexec", pid);
+ log_warning("kexec failed. Falling back to normal reboot.");