From: Willy Tarreau Date: Mon, 13 Mar 2017 19:30:12 +0000 (+0100) Subject: MINOR: kqueue: exclusively rely on the kqueue returned status X-Git-Tag: v1.8-dev1~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd437d9a4c4ff6aa2d4003ab121790ae08020784;p=thirdparty%2Fhaproxy.git MINOR: kqueue: exclusively rely on the kqueue returned status 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. --- diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index de7da655b2..e6338e6973 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -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))