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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user