1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

Kernel: waitpid() should unblock and -ECHILD if SIG_IGN reaps child

This commit is contained in:
Andreas Kling 2019-09-08 13:54:48 +02:00
parent c983e96664
commit 23eafdb8d6
2 changed files with 8 additions and 0 deletions

View file

@ -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;