fixup! linux: close streams without an extra read

This commit is contained in:
Jameson Nash 2026-03-20 01:06:51 +00:00
parent 6e5445d4f9
commit 7e18a84964

View File

@ -60,15 +60,8 @@ void uv__poll_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
if (events & UV__POLLRDHUP)
pevents |= UV_DISCONNECT;
/* Work around an epoll quirk where it sometimes reports just the EPOLLERR or
* EPOLLHUP event. But our tests expect to hear about the events they are
* interested in even in this case, so merge those in also.
*
* Note to self: happens when epoll reports EPOLLIN|EPOLLHUP, the user reads
* the available data, calls uv_poll_stop(), then sometime later calls
* uv_poll_start() again. By then, libuv has forgotten about the hangup and
* the kernel won't report EPOLLIN again because there's nothing left to read.
*/
/* On error or hangup, mix in events the user is interested in so the
* appropriate read/write callbacks are invoked. */
if (events & (POLLERR | POLLHUP))
pevents |=
w->pevents & (UV_READABLE | UV_PRIORITIZED | UV_WRITABLE | UV_DISCONNECT);