From b7d07d78e976acc453c9ba8f8409650c2ad8a585 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 26 Nov 2024 18:58:45 +0100 Subject: [PATCH] Revert "kqueue: change EV_OOBAND to EVFILT_EXCEPT+NOTE_OOB (#4597)" (#4623) Unsupported on FreeBSD, breaking the build. This reverts commit b1d30f9489771a295c1d9b06402e49a77b3e91e6. --- src/unix/kqueue.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/unix/kqueue.c b/src/unix/kqueue.c index b0962b97..e0166c34 100644 --- a/src/unix/kqueue.c +++ b/src/unix/kqueue.c @@ -37,6 +37,17 @@ #include #include +/* + * Required on + * - Until at least FreeBSD 11.0 + * - Older versions of Mac OS X + * + * http://www.boost.org/doc/libs/1_61_0/boost/asio/detail/kqueue_reactor.hpp + */ +#ifndef EV_OOBAND +#define EV_OOBAND EV_FLAG1 +#endif + static void uv__fs_event(uv_loop_t* loop, uv__io_t* w, unsigned int fflags); @@ -220,7 +231,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { } if ((w->events & UV__POLLPRI) == 0 && (w->pevents & UV__POLLPRI) != 0) { - EV_SET(events + nevents, w->fd, EVFILT_EXCEPT, EV_ADD, NOTE_OOB, 0, 0); + EV_SET(events + nevents, w->fd, EV_OOBAND, EV_ADD, 0, 0, 0); if (++nevents == ARRAY_SIZE(events)) { if (kevent(loop->backend_fd, events, nevents, NULL, 0, NULL)) @@ -382,7 +393,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { revents |= UV__POLLRDHUP; } - if (ev->filter == EVFILT_EXCEPT) { + if (ev->filter == EV_OOBAND) { if (w->pevents & UV__POLLPRI) revents |= UV__POLLPRI; else