From 9d54f21859e9d37b80e8afcbdf99215c53a4f278 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 16 May 2020 01:52:19 +0430 Subject: Kernel: wait() should not block if WNOHANG is specified --- Kernel/Process.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Kernel/Process.cpp') diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e910533efb..84cc455a73 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -2466,8 +2466,9 @@ KResultOr Process::do_waitid(idtype_t idtype, int id, int options) return KResult(-EINVAL); } - if (Thread::current->block(options, waitee_pid) != Thread::BlockResult::WokeNormally) - return KResult(-EINTR); + if (!(options & WNOHANG)) + if (Thread::current->block(options, waitee_pid) != Thread::BlockResult::WokeNormally) + return KResult(-EINTR); InterruptDisabler disabler; -- cgit v1.2.3