From: David Woodhouse Date: Wed, 6 Apr 2022 15:42:09 +0000 (+0100) Subject: epoll: Handle EPOLLERR as 'readable' X-Git-Tag: v9.00~76 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5a981e5c019010200f46f97aec32a9e84861968e;p=users%2Fdwmw2%2Fopenconnect.git 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 --- 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)