mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
Kernel: wait() should not block if WNOHANG is specified
This commit is contained in:
parent
1c4f38749e
commit
9d54f21859
Notes:
sideshowbarker
2024-07-19 06:34:52 +09:00
Author: https://github.com/alimpfard
Commit: 9d54f21859
Pull-request: https://github.com/SerenityOS/serenity/pull/2241
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue