From 0001d8ab26694f5f546da7e8f9d0575b49671500 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 7 Jul 2012 18:17:40 +0200 Subject: [PATCH] uloop: handle EPOLLHUP like EPOLLERR to prevent infinite tight loops between epoll_wait() and the continue in uloop_run_events() --- uloop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uloop.c b/uloop.c index bdda0cf..38da5f6 100644 --- a/uloop.c +++ b/uloop.c @@ -231,12 +231,12 @@ static void uloop_run_events(int timeout) if (!u) continue; - if(events[n].events & EPOLLERR) { + if(events[n].events & (EPOLLERR|EPOLLHUP)) { u->error = true; uloop_fd_delete(u); } - if(!(events[n].events & (EPOLLRDHUP|EPOLLIN|EPOLLOUT|EPOLLERR))) + if(!(events[n].events & (EPOLLRDHUP|EPOLLIN|EPOLLOUT|EPOLLERR|EPOLLHUP))) continue; if(events[n].events & EPOLLRDHUP)