Merge pull request #1795 from akaufmann/devel
ignore signal SIGPIPE on Darwin
This commit is contained in:
commit
3bd542b7ca
2 changed files with 6 additions and 2 deletions
|
|
@ -1570,9 +1570,9 @@ else:
|
||||||
|
|
||||||
|
|
||||||
when defined(macosx):
|
when defined(macosx):
|
||||||
|
# We can't use the NOSIGNAL flag in the ``send`` function, it has no effect
|
||||||
var
|
var
|
||||||
MSG_HAVEMORE* {.importc, header: "<sys/socket.h>".}: cint
|
MSG_NOSIGNAL* = 0'i32
|
||||||
MSG_NOSIGNAL* = MSG_HAVEMORE
|
|
||||||
else:
|
else:
|
||||||
var
|
var
|
||||||
MSG_NOSIGNAL* {.importc, header: "<sys/socket.h>".}: cint
|
MSG_NOSIGNAL* {.importc, header: "<sys/socket.h>".}: cint
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,10 @@ proc selectWrite*(writefds: var seq[SocketHandle],
|
||||||
|
|
||||||
pruneSocketSet(writefds, (wr))
|
pruneSocketSet(writefds, (wr))
|
||||||
|
|
||||||
|
# We ignore signal SIGPIPE on Darwin
|
||||||
|
when defined(macosx):
|
||||||
|
signal(SIGPIPE, SIG_IGN)
|
||||||
|
|
||||||
when defined(Windows):
|
when defined(Windows):
|
||||||
var wsa: WSAData
|
var wsa: WSAData
|
||||||
if wsaStartup(0x0101'i16, addr wsa) != 0: raiseOSError(osLastError())
|
if wsaStartup(0x0101'i16, addr wsa) != 0: raiseOSError(osLastError())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue