From 5a981e5c019010200f46f97aec32a9e84861968e Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 6 Apr 2022 16:42:09 +0100 Subject: [PATCH] epoll: Handle EPOLLERR as 'readable' When we use select(), an error event on a file descriptor causes it to be reported as readable, and some of the handlers will only clean it up if that happens. So set the 'readable' flag on EPOLLERR too. This is part of #389. Signed-off-by: David Woodhouse --- mainloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mainloop.c b/mainloop.c index a459dfb9..4c2863fa 100644 --- a/mainloop.c +++ b/mainloop.c @@ -372,7 +372,7 @@ int openconnect_mainloop(struct openconnect_info *vpninfo, nfds = 0; } while (nfds--) { - if (evs[nfds].events & EPOLLIN) { + if (evs[nfds].events & (EPOLLIN|EPOLLERR)) { if (evs[nfds].data.fd == vpninfo->tun_fd) tun_r = 1; else if (evs[nfds].data.fd == vpninfo->ssl_fd) -- 2.50.1