]> granicus.if.org Git - libevent/commitdiff
Fix a spurious-call bug on epoll.c
authorNick Mathewson <nickm@torproject.org>
Fri, 1 Oct 2010 03:15:47 +0000 (23:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 1 Oct 2010 03:15:47 +0000 (23:15 -0400)
We were trying to check whether any events had really been
notified on an fd before calling evmap_io_active on it, but instead
we were checking for an event pointer, which was always true.

In practice, this patch shouldn't change much, since epoll_wait
shouldn't return an event unless there is actually an event going
on.

Spotted by an anonymous bug reporter on Sourceforge.  Closes bug
3078425.

epoll.c

diff --git a/epoll.c b/epoll.c
index 4f4a512c84e82fe04f2a0646c1f682b536c015e8..b574bf4d592fe39b3321c92d29798b2e5e244ada 100644 (file)
--- a/epoll.c
+++ b/epoll.c
@@ -349,7 +349,7 @@ epoll_dispatch(struct event_base *base, struct timeval *tv)
                                ev |= EV_WRITE;
                }
 
-               if (!events)
+               if (!ev)
                        continue;
 
                evmap_io_active(base, events[i].data.fd, ev | EV_ET);