about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorBaoshanPang <pangbw@gmail.com>2019-12-20 13:59:52 -0800
committerBaoshanPang <pangbw@gmail.com>2020-01-06 16:11:45 -0800
commitcec957e1542c062e97f664aab5b23ebd532f5c85 (patch)
tree26080af679d937387d7b11dc1424a8dec0bdfdd2 /src/libstd/sys
parent012127b3fe7bf192530cb620297510539fb8159d (diff)
downloadrust-cec957e1542c062e97f664aab5b23ebd532f5c85.tar.gz
rust-cec957e1542c062e97f664aab5b23ebd532f5c85.zip
ignore signal SIGPIPE
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/vxworks/mod.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libstd/sys/vxworks/mod.rs b/src/libstd/sys/vxworks/mod.rs
index f102e4d6adf..12bbfa1d4e1 100644
--- a/src/libstd/sys/vxworks/mod.rs
+++ b/src/libstd/sys/vxworks/mod.rs
@@ -36,18 +36,10 @@ pub use crate::sys_common::os_str_bytes as os_str;
 
 #[cfg(not(test))]
 pub fn init() {
-    // By default, some platforms will send a *signal* when an EPIPE error
-    // would otherwise be delivered. This runtime doesn't install a SIGPIPE
-    // handler, causing it to kill the program, which isn't exactly what we
-    // want!
-    //
-    // Hence, we set SIGPIPE to ignore when the program starts up in order
-    // to prevent this problem.
+    // ignore SIGPIPE
     unsafe {
-        reset_sigpipe();
+        assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR);
     }
-
-    unsafe fn reset_sigpipe() {}
 }
 
 pub use libc::signal;