summary refs log tree commit diff stats
path: root/lib/posix/posix.nim
diff options
context:
space:
mode:
authoryglukhov <yuriy.glukhov@gmail.com>2015-04-07 20:12:29 +0300
committeryglukhov <yuriy.glukhov@gmail.com>2015-04-08 11:24:53 +0300
commitc2a52a98490e0f7ad19d3e83918d73262670122b (patch)
treeba976106ac8efbc228568b704a109772c2cb6918 /lib/posix/posix.nim
parentd5dc0e96d0a65eaa39fe3169248c8f873da8cd25 (diff)
downloadNim-c2a52a98490e0f7ad19d3e83918d73262670122b.tar.gz
Fixed SIGPIPE on MacOS
Diffstat (limited to 'lib/posix/posix.nim')
-rw-r--r--lib/posix/posix.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 5c3190bf7..0c7b84090 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -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