diff --git a/sortix/kernel.cpp b/sortix/kernel.cpp index 7bd0c359..6620982d 100644 --- a/sortix/kernel.cpp +++ b/sortix/kernel.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -331,6 +332,8 @@ static void BootThread(void* /*user*/) if ( pid != init->pid ) PanicF("Waiting for init to exit returned %i (errno=%i)", pid, errno); + status = WEXITSTATUS(status); + switch ( status ) { case 0: CPU::ShutDown(); diff --git a/utils/init.cpp b/utils/init.cpp index 0a199790..76e51921 100644 --- a/utils/init.cpp +++ b/utils/init.cpp @@ -55,7 +55,7 @@ int runsystem() printf("Looks like the system crashed, trying to bring it back up.\n"); return runsystem(); } - return status; + return WEXITSTATUS(status); } int ret = child();