--- ./src/reboot_system.h2.jk2 2006-06-29 10:53:17.000000000 +0300 +++ ./src/reboot_system.h2 2006-08-16 10:29:16.000000000 +0300 @@ -1,8 +1,20 @@ #include #include +#include +#include /* sysdep: +std reboot */ int reboot_system(int what) { - return(reboot(what)); + int pid, status; + /* fork() before calling reboot since the linux kernel calls do_exit(0) in + * kernel/sys.c, which can cause kernel to panic as + * the init process would exit ... + */ + if ((pid = fork()) == 0) { + reboot(what); + _exit(0); + } + waitpid(pid, &status, 0); + return(0); }