1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-16 10:19:55 +00:00

Merge branch 'master' into compile-opt

This commit is contained in:
Calvin Rose 2023-11-01 17:36:14 -05:00
commit 31be7bad8e
2 changed files with 4 additions and 5 deletions

View File

@ -1818,8 +1818,8 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp timeout) {
JanetStream *stream = janet_vm.streams[i];
janet_vm.fds[i + 1].events = 0;
janet_vm.fds[i + 1].revents = 0;
if (stream->read_fiber) janet_vm.fds[i + 1].events |= POLLIN;
if (stream->write_fiber) janet_vm.fds[i + 1].events |= POLLOUT;
if (stream->read_fiber && stream->read_fiber->ev_callback) janet_vm.fds[i + 1].events |= POLLIN;
if (stream->write_fiber && stream->write_fiber->ev_callback) janet_vm.fds[i + 1].events |= POLLOUT;
}
/* Poll for events */

View File

@ -125,7 +125,7 @@ void net_callback_connect(JanetFiber *fiber, JanetAsyncEvent event) {
default:
break;
#ifndef JANET_WINDOWS
/* Wait until we have an actually event before checking.
/* Wait until we have an actual event before checking.
* Windows doesn't support async connect with this, just try immediately.*/
case JANET_ASYNC_EVENT_INIT:
#endif
@ -160,7 +160,7 @@ void net_callback_connect(JanetFiber *fiber, JanetAsyncEvent event) {
janet_async_end(fiber);
}
static void net_sched_connect(JanetStream *stream) {
static JANET_NO_RETURN void net_sched_connect(JanetStream *stream) {
NetStateConnect *state = janet_malloc(sizeof(NetStateConnect));
state->did_connect = 0;
janet_async_start(stream, JANET_ASYNC_LISTEN_WRITE, net_callback_connect, state);
@ -575,7 +575,6 @@ JANET_CORE_FN(cfun_net_connect,
}
net_sched_connect(stream);
janet_await();
}
static const char *serverify_socket(JSock sfd) {