Kernel: wait() should not block if WNOHANG is specified

This commit is contained in:
AnotherTest 2020-05-16 01:52:19 +04:30 committed by Andreas Kling
commit 9d54f21859
Notes: sideshowbarker 2024-07-19 06:34:52 +09:00

View file

@ -2466,8 +2466,9 @@ KResultOr<siginfo_t> Process::do_waitid(idtype_t idtype, int id, int options)
return KResult(-EINVAL);
}
if (Thread::current->block<Thread::WaitBlocker>(options, waitee_pid) != Thread::BlockResult::WokeNormally)
return KResult(-EINTR);
if (!(options & WNOHANG))
if (Thread::current->block<Thread::WaitBlocker>(options, waitee_pid) != Thread::BlockResult::WokeNormally)
return KResult(-EINTR);
InterruptDisabler disabler;