1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-17 22:24:49 +00:00

Allow for unregistered streams w/ kqueue.

This commit is contained in:
Calvin Rose 2023-10-08 17:21:42 -05:00
parent b344702304
commit 990f6352e0
2 changed files with 4 additions and 11 deletions

View File

@ -1680,14 +1680,7 @@ void janet_register_stream(JanetStream *stream) {
status = kevent(janet_vm.kq, kevs, length, NULL, 0, NULL); status = kevent(janet_vm.kq, kevs, length, NULL, 0, NULL);
} while (status == -1 && errno == EINTR); } while (status == -1 && errno == EINTR);
if (status == -1) { 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; stream->flags |= JANET_STREAM_UNREGISTERED;
} else {
/* Unexpected error */
janet_panicv(janet_ev_lasterr());
}
} }
} }