From dd437d9a4c4ff6aa2d4003ab121790ae08020784 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 13 Mar 2017 20:30:12 +0100 Subject: [PATCH] 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. --- src/ev_kqueue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index de7da65..e6338e6 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)) -- 1.7.10.4