about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAnatol Pomozov <anatol.pomozov@gmail.com>2017-04-03 22:41:55 -0700
committerAnatol Pomozov <anatol.pomozov@gmail.com>2017-04-03 22:44:25 -0700
commit6132fb83b45cc9c519c2fee29e497460db06ba2a (patch)
tree4b7eef0b7d7f2315b4104d24538c49a932db0790 /src/libstd/sys
parent5309a3e31d88def1f3ea966162ed4f81f161d500 (diff)
downloadrust-6132fb83b45cc9c519c2fee29e497460db06ba2a.tar.gz
rust-6132fb83b45cc9c519c2fee29e497460db06ba2a.zip
Replace magic number with readable sig constant
SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index c57751a01d7..854d380d128 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -92,7 +92,7 @@ pub fn init() {
 
     #[cfg(not(any(target_os = "nacl", target_os = "emscripten", target_os="fuchsia")))]
     unsafe fn reset_sigpipe() {
-        assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0);
+        assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR);
     }
     #[cfg(any(target_os = "nacl", target_os = "emscripten", target_os="fuchsia"))]
     unsafe fn reset_sigpipe() {}