]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #41054 - anatol:master, r=alexcrichton
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Wed, 5 Apr 2017 23:01:12 +0000 (23:01 +0000)
committerGitHub <noreply@github.com>
Wed, 5 Apr 2017 23:01:12 +0000 (23:01 +0000)
Replace magic number with readable sig constant

SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'

src/libstd/sys/unix/mod.rs

index c57751a01d7c1b6f0293da4c000cd33b51e0dab4..854d380d128c9d18d500297b7ecaa07badce30a3 100644 (file)
@@ -92,7 +92,7 @@ fn oom_handler() -> ! {
 
     #[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() {}