Prevent EPIPE causing ICEs in rustc and rustdoc

This commit is contained in:
varkor
2018-04-10 23:55:41 +01:00
parent 4b9b70c394
commit 7ab31f6556
4 changed files with 19 additions and 3 deletions

View File

@@ -80,11 +80,11 @@ pub fn init() {
reset_sigpipe();
}
#[cfg(not(any(target_os = "emscripten", target_os="fuchsia")))]
#[cfg(not(any(target_os = "emscripten", target_os = "fuchsia")))]
unsafe fn reset_sigpipe() {
assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR);
}
#[cfg(any(target_os = "emscripten", target_os="fuchsia"))]
#[cfg(any(target_os = "emscripten", target_os = "fuchsia"))]
unsafe fn reset_sigpipe() {}
}