From 7e18a84964aa9b99137696f28dbee3eb7d0c6fb1 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 20 Mar 2026 01:06:51 +0000 Subject: [PATCH] fixup! linux: close streams without an extra read --- src/unix/poll.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/unix/poll.c b/src/unix/poll.c index 0b308801b..41429efc7 100644 --- a/src/unix/poll.c +++ b/src/unix/poll.c @@ -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);