Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions library/std/src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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.
Expand Down