mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
Fall back to kexec when no kexec binary exists
This may be not a popular setup, but in case kexec resides somewhere different than the default location for KEXEC (`/usr/sbin/kexec`), don't just reboot and try doing `reboot(RB_KEXEC)` instead, just like what `kexec -e` normally does.
This commit is contained in:
parent
cdc6c95737
commit
71180f8e57
|
@ -547,6 +547,9 @@ int main(int argc, char *argv[]) {
|
|||
/* Child */
|
||||
|
||||
execv(args[0], (char * const *) args);
|
||||
|
||||
/* execv failed (kexec binary missing?), so try simply reboot(RB_KEXEC) */
|
||||
(void) reboot(cmd);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue