mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Stop reporting POLLHUP exclusively when available in sys$poll
As per Dr. Posix, unlike POLLERR and POLLNVAL, POLLHUP is only mutually exclusive with POLLOUT, all other events may be reported together with it.
This commit is contained in:
parent
08e88bfcad
commit
68980bf711
Notes:
sideshowbarker
2024-07-17 09:32:48 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/68980bf711 Pull-request: https://github.com/SerenityOS/serenity/pull/14533 Reviewed-by: https://github.com/linusg ✅
1 changed files with 4 additions and 4 deletions
|
@ -96,11 +96,11 @@ ErrorOr<FlatPtr> Process::sys$poll(Userspace<Syscall::SC_poll_params const*> use
|
|||
if (fds_entry.unblocked_flags == BlockFlags::None)
|
||||
continue;
|
||||
|
||||
if (has_any_flag(fds_entry.unblocked_flags, BlockFlags::WriteError | BlockFlags::WriteHangUp) || !fds_entry.description) {
|
||||
if (has_flag(fds_entry.unblocked_flags, BlockFlags::WriteHangUp))
|
||||
pfd.revents |= POLLHUP;
|
||||
if (has_flag(fds_entry.unblocked_flags, BlockFlags::WriteError) || !fds_entry.description) {
|
||||
if (has_flag(fds_entry.unblocked_flags, BlockFlags::WriteError))
|
||||
pfd.revents |= POLLERR;
|
||||
if (has_flag(fds_entry.unblocked_flags, BlockFlags::WriteHangUp))
|
||||
pfd.revents |= POLLHUP;
|
||||
if (!fds_entry.description)
|
||||
pfd.revents |= POLLNVAL;
|
||||
} else {
|
||||
|
@ -112,7 +112,7 @@ ErrorOr<FlatPtr> Process::sys$poll(Userspace<Syscall::SC_poll_params const*> use
|
|||
VERIFY(pfd.events & POLLPRI);
|
||||
pfd.revents |= POLLPRI;
|
||||
}
|
||||
if (has_flag(fds_entry.unblocked_flags, BlockFlags::Write)) {
|
||||
if (!has_flag(fds_entry.unblocked_flags, BlockFlags::WriteHangUp) && has_flag(fds_entry.unblocked_flags, BlockFlags::Write)) {
|
||||
VERIFY(pfd.events & POLLOUT);
|
||||
pfd.revents |= POLLOUT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue