Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/posix/posix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1570,9 +1570,9 @@ else:


when defined(macosx):
# We can't use the NOSIGNAL flag in the ``send`` function, it has no effect
var
MSG_HAVEMORE* {.importc, header: "<sys/socket.h>".}: cint
MSG_NOSIGNAL* = MSG_HAVEMORE
MSG_NOSIGNAL* = 0'i32
else:
var
MSG_NOSIGNAL* {.importc, header: "<sys/socket.h>".}: cint
Expand Down
4 changes: 4 additions & 0 deletions lib/pure/rawsockets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ proc selectWrite*(writefds: var seq[SocketHandle],

pruneSocketSet(writefds, (wr))

# We ignore signal SIGPIPE on Darwin
when defined(macosx):
signal(SIGPIPE, SIG_IGN)

when defined(Windows):
var wsa: WSAData
if wsaStartup(0x0101'i16, addr wsa) != 0: raiseOSError(osLastError())