r5370: epoll gives more precise event bits like EPOLLHUP instead of just EPOLLIN...
authorAndrew Tridgell <tridge@samba.org>
Sun, 13 Feb 2005 08:52:12 +0000 (08:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:48 +0000 (13:09 -0500)
these to "read" events for the events code to work on errors like connection refused
(thanks to vl for noticing this bug)
(This used to be commit 7c379590b4ca808eddef5c3ac15db25cefc5215b)

source4/lib/events/events.c

index 34606273995bccde2e9309795a3213ce31ba299a..97836037593e239a2bb823ee0a525fec7552b565 100644 (file)
@@ -404,7 +404,8 @@ static int event_loop_epoll(struct event_context *ev, struct timeval *tvalp)
                        epoll_fallback_to_select(ev, "epoll_wait() gave bad data");
                        return -1;
                }
-               if (events[i].events & EPOLLIN) flags |= EVENT_FD_READ;
+               if (events[i].events & (EPOLLIN|EPOLLHUP|EPOLLERR)) 
+                       flags |= EVENT_FD_READ;
                if (events[i].events & EPOLLOUT) flags |= EVENT_FD_WRITE;
                if (flags) {
                        fde->handler(ev, fde, flags, fde->private);