From 0b94239912221477b95220b1024af3cbc2305cb5 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 9 Sep 2012 23:08:03 +0200 Subject: [PATCH] Fix missing WEXITSTATUS in init and kernel. --- sortix/kernel.cpp | 3 +++ utils/init.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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();