1
0
mirror of https://github.com/janet-lang/janet synced 2026-01-06 23:29:05 +00:00

Merge pull request #1683 from llmII/fix-unix-sockets

Fix unix sockets issue on FreeBSD
This commit is contained in:
Calvin Rose
2025-12-14 13:23:33 -06:00
committed by GitHub

View File

@@ -572,7 +572,15 @@ JANET_CORE_FN(cfun_net_connect,
}
#endif
if (status) {
if (status == 0) {
/* Connect completed synchronously (common for unix domain sockets).
* Return the stream directly without scheduling an async wait,
* as edge-triggered kqueue may not signal EVFILT_WRITE if the socket
* is already connected when registered. */
return janet_wrap_abstract(stream);
}
if (status == -1) {
#ifdef JANET_WINDOWS
if (err != WSAEWOULDBLOCK) {
#else