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

@ -1580,8 +1580,11 @@ else:
when defined(macosx):
# We can't use the NOSIGNAL flag in the ``send`` function, it has no effect
var
# Instead we should use SO_NOSIGPIPE in setsockopt
const
MSG_NOSIGNAL* = 0'i32
var
SO_NOSIGPIPE* {.importc, header: "<sys/socket.h>".}: cint
else:
var
MSG_NOSIGNAL* {.importc, header: "<sys/socket.h>".}: cint