From 4402207b983b6ad4e317ef5affa4a78f10903a26 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 18 May 2020 13:05:25 +0200 Subject: [PATCH] Kernel: WaitBlocker should always unblock immediately on WNOHANG This fixes a problem where we'd block if a process with no children would call sys$waitid() with WNOHANG. This unbreaks bash :^) --- Kernel/Scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index c1126d9bde..1c3f3b19fc 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -251,7 +251,7 @@ Thread::WaitBlocker::WaitBlocker(int wait_options, pid_t& waitee_pid) bool Thread::WaitBlocker::should_unblock(Thread& thread, time_t, long) { - bool should_unblock = false; + bool should_unblock = m_wait_options & WNOHANG; if (m_waitee_pid != -1) { auto* peer = Process::from_pid(m_waitee_pid); if (!peer)