From 4be2cb895cd0562de6c32cd4728ae4906936fb0e Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 28 Jul 2020 06:34:07 +0430 Subject: [PATCH] Shell: Do not assume that wstatus is valid after wait() returns 0 According to the linux waitid manpage, the value of wstatus is unspecified if wait() returns 0, so we should not assume that any value it holds is correct (including the exit code). This is only applicable to the Lagom build. --- Shell/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shell/main.cpp b/Shell/main.cpp index 06b89fedb5..0653a1b383 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -99,7 +99,7 @@ int main(int argc, char** argv) #ifndef __serenity__ if (child_pid == 0) { // Linux: if child didn't "change state", but existed. - child_pid = job.value->pid(); + continue; } #endif if (child_pid == job.value->pid()) {