Fixed SIGPIPE on MacOS
This commit is contained in:
parent
d5dc0e96d0
commit
c2a52a9849
3 changed files with 11 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue