Kernel: Set POLLHUP on WriteHangUp in sys$poll instead of POLLNVAL

POLLNVAL signifies an invalid fd, not a write hang up.
This commit is contained in:
Idan Horowitz 2022-07-09 23:55:47 +03:00 committed by Andreas Kling
parent 020c898290
commit 5ca46abb51
Notes: sideshowbarker 2024-07-17 09:33:03 +09:00

View file

@ -97,7 +97,7 @@ ErrorOr<FlatPtr> Process::sys$poll(Userspace<Syscall::SC_poll_params const*> use
if (has_flag(fds_entry.unblocked_flags, BlockFlags::WriteError))
pfd.revents |= POLLERR;
if (has_flag(fds_entry.unblocked_flags, BlockFlags::WriteHangUp))
pfd.revents |= POLLNVAL;
pfd.revents |= POLLHUP;
} else {
if (has_flag(fds_entry.unblocked_flags, BlockFlags::Read)) {
VERIFY(pfd.events & POLLIN);