summaryrefslogtreecommitdiff
path: root/Kernel/Scheduler.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-08 13:54:48 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-08 14:01:00 +0200
commit23eafdb8d6f1c866049dfe39281af42b68fe0d79 (patch)
treea230a01e3930e3085a2d95f81a358c246b2af9cd /Kernel/Scheduler.cpp
parentc983e966645d292594284c8fca29a4b4ae225e82 (diff)
downloadserenity-23eafdb8d6f1c866049dfe39281af42b68fe0d79.zip
Kernel: waitpid() should unblock and -ECHILD if SIG_IGN reaps child
Diffstat (limited to 'Kernel/Scheduler.cpp')
-rw-r--r--Kernel/Scheduler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp
index 6e56b97b00..fe8c6459a6 100644
--- a/Kernel/Scheduler.cpp
+++ b/Kernel/Scheduler.cpp
@@ -195,6 +195,11 @@ Thread::WaitBlocker::WaitBlocker(int wait_options, pid_t& waitee_pid)
bool Thread::WaitBlocker::should_unblock(Thread& thread, time_t, long)
{
bool should_unblock = false;
+ if (m_waitee_pid != -1) {
+ auto* peer = Process::from_pid(m_waitee_pid);
+ if (!peer)
+ return true;
+ }
thread.process().for_each_child([&](Process& child) {
if (m_waitee_pid != -1 && m_waitee_pid != child.pid())
return IterationDecision::Continue;