diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-07-28 06:34:07 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-30 18:47:41 +0200 |
commit | 4be2cb895cd0562de6c32cd4728ae4906936fb0e (patch) | |
tree | ee3b4ed7f7226b3e6481f2e515c5df16075366f0 /Shell | |
parent | 681bb1fb23cfaecb0b62c7b7d919530e0f1c725b (diff) | |
download | serenity-4be2cb895cd0562de6c32cd4728ae4906936fb0e.zip |
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.
Diffstat (limited to 'Shell')
-rw-r--r-- | Shell/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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()) { |