]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: kqueue: exclusively rely on the kqueue returned status
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Mar 2017 19:30:12 +0000 (20:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Mar 2017 15:35:17 +0000 (16:35 +0100)
After commit e852545 ("MEDIUM: polling: centralize polled events processing")
all pollers stopped to explicitly check the FD's polled status, except the
kqueue poller which is constructed a bit differently. It doesn't seem possible
to cause any issue such as missing an event however, but anyway it's better to
definitely get rid of this since the event filter already provides the event
direction.

src/ev_kqueue.c

index de7da655b26c7cbc1c051ff5f9ee08ba69d53ba8..e6338e6973f13030c7126a5c13f4e2041454e454 100644 (file)
@@ -125,12 +125,10 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                fdtab[fd].ev &= FD_POLL_STICKY;
 
                if (kev[count].filter ==  EVFILT_READ) {
-                       if ((fdtab[fd].state & FD_EV_STATUS_R))
-                               fdtab[fd].ev |= FD_POLL_IN;
+                       fdtab[fd].ev |= FD_POLL_IN;
                }
                else if (kev[count].filter ==  EVFILT_WRITE) {
-                       if ((fdtab[fd].state & FD_EV_STATUS_W))
-                               fdtab[fd].ev |= FD_POLL_OUT;
+                       fdtab[fd].ev |= FD_POLL_OUT;
                }
 
                if (fdtab[fd].ev & (FD_POLL_IN | FD_POLL_HUP | FD_POLL_ERR))