From 06cb00c84f7ff6450cd902b7dc902dc317d0142b Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 18 Jun 2018 09:11:01 -0400 Subject: [PATCH] linux: handle exclusive POLLHUP with UV_DISCONNECT In commit c7c8e916b8 (poll: add UV_DISCONNECT event, 2016-01-11) we forgot to update the workaround added by commit 24bfef2ef4 (linux: handle EPOLLHUP without EPOLLIN/EPOLLOUT, 2013-11-08). On linux-sparc64, epoll returns just POLLHUP during part of our `poll_duplex` and `poll_unidirectional` tests, triggering the need for the workaround to recognize UV_DISCONNECT. Fixes: https://github.com/libuv/libuv/issues/1859 PR-URL: https://github.com/libuv/libuv/pull/1896 Reviewed-By: Santiago Gimeno Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- src/unix/linux-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/linux-core.c b/src/unix/linux-core.c index 516556fb1..d09bbcdd6 100644 --- a/src/unix/linux-core.c +++ b/src/unix/linux-core.c @@ -388,7 +388,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { * free when we switch over to edge-triggered I/O. */ if (pe->events == POLLERR || pe->events == POLLHUP) - pe->events |= w->pevents & (POLLIN | POLLOUT | UV__POLLPRI); + pe->events |= + w->pevents & (POLLIN | POLLOUT | UV__POLLRDHUP | UV__POLLPRI); if (pe->events != 0) { /* Run signal watchers last. This also affects child process watchers