1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 23:17:46 +00:00

change ~ improve naming and documentation of default SIGPIPE handling

This commit is contained in:
Roy Ivy III 2020-05-06 12:57:30 -05:00
parent b0d02e7f43
commit 503cc53014

View file

@ -1,6 +1,12 @@
// spell-checker:ignore () SIGPIPE maint uutils
use std::panic;
pub fn install_sigpipe_hook() {
//## SIGPIPE handling background/discussions ...
//* `uutils` ~ <https://github.com/uutils/coreutils/issues/374> , <https://github.com/uutils/coreutils/pull/1106>
//* rust and `rg` ~ <https://github.com/rust-lang/rust/issues/62569> , <https://github.com/BurntSushi/ripgrep/issues/200> , <https://github.com/crev-dev/cargo-crev/issues/287>
pub fn mute_sigpipe_panic() {
let hook = panic::take_hook();
panic::set_hook(Box::new(move |info| {
if let Some(res) = info.payload().downcast_ref::<String>() {