]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] kqueue: do not manually remove fds
authorWilly Tarreau <w@1wt.eu>
Mon, 9 Apr 2007 15:16:07 +0000 (17:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Apr 2007 15:16:07 +0000 (17:16 +0200)
FDs attached to a kevent are automatically removed after close().
Also, do not mark the FDs as EV_CLEAR. We want to stay informed
about readiness.

src/ev_kqueue.c

index 4f9d6840d17057492ab6bf5e9ce64042bad374bc..39583431136a807a8e7833137688ff638a161213 100644 (file)
@@ -65,7 +65,7 @@ REGPRM2 static int __fd_set(const int fd, int dir)
                return 0;
 
        FD_SET(fd, fd_evts[dir]);
-       EV_SET(kev, fd, dir2filt[dir], EV_ADD|EV_CLEAR, 0, 0, NULL);
+       EV_SET(kev, fd, dir2filt[dir], EV_ADD, 0, 0, NULL);
        kevent(kqueue_fd, kev, 1, NULL, 0, NULL);
        return 1;
 }
@@ -89,6 +89,12 @@ REGPRM1 static void __fd_rem(int fd)
                kevent(kqueue_fd, kev, changes, NULL, 0, NULL);
 }
 
+REGPRM1 static void __fd_clo(int fd)
+{
+       FD_CLR(fd, fd_evts[DIR_RD]);
+       FD_CLR(fd, fd_evts[DIR_WR]);
+}
+
 /*
  * kqueue() poller
  */