- if ((oev ^ nev) & EV_WRITE)
- {
- if (nev & EV_WRITE)
- kqueue_change (fd, EVFILT_WRITE, EV_ADD, NOTE_EOF);
- else
- kqueue_change (fd, EVFILT_WRITE, EV_DELETE, 0);
- }
+ if (oev & EV_READ)
+ kqueue_change (EV_A_ fd, EVFILT_READ, EV_DELETE, 0);
+
+ if (oev & EV_WRITE)
+ kqueue_change (EV_A_ fd, EVFILT_WRITE, EV_DELETE, 0);
+
+ if (nev & EV_READ)
+ kqueue_change (EV_A_ fd, EVFILT_READ, EV_ADD, NOTE_EOF);
+
+ if (nev & EV_WRITE)
+ kqueue_change (EV_A_ fd, EVFILT_WRITE, EV_ADD, NOTE_EOF);