diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-08 13:54:48 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-08 14:01:00 +0200 |
commit | 23eafdb8d6f1c866049dfe39281af42b68fe0d79 (patch) | |
tree | a230a01e3930e3085a2d95f81a358c246b2af9cd /Kernel/Process.cpp | |
parent | c983e966645d292594284c8fca29a4b4ae225e82 (diff) | |
download | serenity-23eafdb8d6f1c866049dfe39281af42b68fe0d79.zip |
Kernel: waitpid() should unblock and -ECHILD if SIG_IGN reaps child
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index cccea564dc..ec2fdb064f 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1554,6 +1554,9 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options) // NOTE: If waitee was -1, m_waitee_pid will have been filled in by the scheduler. Process* waitee_process = Process::from_pid(waitee_pid); + if (!waitee_process) + return -ECHILD; + ASSERT(waitee_process); if (waitee_process->is_dead()) { exit_status = reap(*waitee_process); |