From 8a9be9d837ce46150920ed96ba28a680f49313cc Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 8 Oct 2023 13:46:24 -0500 Subject: [PATCH] Make sure posted events are read from non-blocking socket. --- src/core/ev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ev.c b/src/core/ev.c index b610d918..f5d5e753 100644 --- a/src/core/ev.c +++ b/src/core/ev.c @@ -1401,7 +1401,7 @@ void janet_loop(void) { #else static void janet_ev_setup_selfpipe(void) { - if (janet_make_pipe(janet_vm.selfpipe, 0)) { + if (janet_make_pipe(janet_vm.selfpipe, 1)) { JANET_EXIT("failed to initialize self pipe in event loop"); } } @@ -1740,7 +1740,7 @@ void janet_ev_init(void) { janet_vm.timer_enabled = 0; if (janet_vm.kq == -1) goto error; struct kevent event; - EV_SETx(&event, janet_vm.selfpipe[0], EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR, 0, 0, janet_vm.selfpipe); + EV_SETx(&event, janet_vm.selfpipe[0], EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, janet_vm.selfpipe); int status; do { status = kevent(janet_vm.kq, &event, 1, NULL, 0, NULL);