Fixed SIGPIPE on MacOS

This commit is contained in:
yglukhov 2015-04-07 20:12:29 +03:00
commit c2a52a9849
3 changed files with 11 additions and 6 deletions

View file

@ -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())