From 865c2f04684e53c81e49f2676e6126c305ba86ea Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 26 May 2022 21:43:59 +0200 Subject: [PATCH] Stop SIG_IGNoring SIGPIPE in library/std/src/sys/unix/mod.rs --- library/std/src/sys/unix/mod.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 8e909aab7f0ca..ccff5c7360fc4 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -54,15 +54,6 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) { // resources opened later, we reopen standards streams when they are closed. sanitize_standard_fds(); - // 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. - reset_sigpipe(); - stack_overflow::init(); args::init(argc, argv); @@ -116,11 +107,6 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) { } } } - - unsafe fn reset_sigpipe() { - #[cfg(not(any(target_os = "emscripten", target_os = "fuchsia")))] - rtassert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR); - } } // SAFETY: must be called only once during runtime cleanup.