From 990f6352e0290f014010aff5312269a209dc5267 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 8 Oct 2023 17:21:42 -0500 Subject: [PATCH] Allow for unregistered streams w/ kqueue. --- src/core/ev.c | 9 +-------- src/core/os.c | 6 +++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/core/ev.c b/src/core/ev.c index e87e001e..1cf10e75 100644 --- a/src/core/ev.c +++ b/src/core/ev.c @@ -1680,14 +1680,7 @@ void janet_register_stream(JanetStream *stream) { status = kevent(janet_vm.kq, kevs, length, NULL, 0, NULL); } while (status == -1 && errno == EINTR); if (status == -1) { - if ((errno == ENODEV) || (errno == EPERM)) { - /* Couldn't add to event loop, so assume that it completes - * synchronously. */ - stream->flags |= JANET_STREAM_UNREGISTERED; - } else { - /* Unexpected error */ - janet_panicv(janet_ev_lasterr()); - } + stream->flags |= JANET_STREAM_UNREGISTERED; } } diff --git a/src/core/os.c b/src/core/os.c index 93f92d92..ba605854 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -2337,9 +2337,9 @@ JANET_CORE_FN(os_permission_int, } JANET_CORE_FN(os_posix_fork, - "(os/posix-fork)", - "Make a `fork` system call and create a new process. Return nil if in the new process, otherwise a core/process object (as returned by os/spawn). " - "Not supported on all systems (POSIX only).") { + "(os/posix-fork)", + "Make a `fork` system call and create a new process. Return nil if in the new process, otherwise a core/process object (as returned by os/spawn). " + "Not supported on all systems (POSIX only).") { janet_sandbox_assert(JANET_SANDBOX_SUBPROCESS); janet_fixarity(argc, 0); (void) argv;