Fixed SIGPIPE on MacOS
This commit is contained in:
parent
d5dc0e96d0
commit
c2a52a9849
3 changed files with 11 additions and 6 deletions
|
|
@ -39,6 +39,9 @@ export
|
|||
SO_KEEPALIVE, SO_OOBINLINE, SO_REUSEADDR,
|
||||
MSG_PEEK
|
||||
|
||||
when defined(macosx):
|
||||
export SO_NOSIGPIPE
|
||||
|
||||
type
|
||||
Port* = distinct uint16 ## port type
|
||||
|
||||
|
|
@ -428,10 +431,6 @@ proc selectWrite*(writefds: var seq[SocketHandle],
|
|||
|
||||
pruneSocketSet(writefds, (wr))
|
||||
|
||||
# We ignore signal SIGPIPE on Darwin
|
||||
when defined(macosx) and not defined(nimdoc):
|
||||
signal(SIGPIPE, SIG_IGN)
|
||||
|
||||
when defined(Windows):
|
||||
var wsa: WSAData
|
||||
if wsaStartup(0x0101'i16, addr wsa) != 0: raiseOSError(osLastError())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue