about summary refs log tree commit diff
path: root/src/rt/rust_uv.cpp
diff options
context:
space:
mode:
authorEric Reed <ecreed@cs.washington.edu>2013-08-08 17:04:19 -0700
committerEric Reed <ecreed@cs.washington.edu>2013-08-19 16:26:50 -0700
commit88f718341ec279738c07f83289058aadf7c5d235 (patch)
tree6f6b3b771f2b211c293aaa6ea83a0000056d1985 /src/rt/rust_uv.cpp
parentf68514c128e536c5868368861871cb665ed9fdd3 (diff)
downloadrust-88f718341ec279738c07f83289058aadf7c5d235.tar.gz
rust-88f718341ec279738c07f83289058aadf7c5d235.zip
Instruct event loops to ignore SIGPIPE when constructed.
libuv does not always catch SIGPIPE.
Diffstat (limited to 'src/rt/rust_uv.cpp')
-rw-r--r--src/rt/rust_uv.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp
index 0462789af9f..b5d6e02b46a 100644
--- a/src/rt/rust_uv.cpp
+++ b/src/rt/rust_uv.cpp
@@ -13,12 +13,21 @@
 #include <malloc.h>
 #endif
 
+#ifndef __WIN32__
+// for signal
+#include <signal.h>
+#endif
+
 #include "uv.h"
 
 #include "rust_globals.h"
 
 extern "C" void*
 rust_uv_loop_new() {
+// XXX libuv doesn't always ignore SIGPIPE even though we don't need it.
+#ifndef __WIN32__
+    signal(SIGPIPE, SIG_IGN);
+#endif
     return (void*)uv_loop_new();
 }