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

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
parent 1c4f38749e
commit 9d54f21859

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;