mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 07:27:46 +00:00
change ~ improve naming and documentation of default SIGPIPE handling
This commit is contained in:
parent
b0d02e7f43
commit
503cc53014
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,12 @@
|
||||||
|
// spell-checker:ignore () SIGPIPE maint uutils
|
||||||
|
|
||||||
use std::panic;
|
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();
|
let hook = panic::take_hook();
|
||||||
panic::set_hook(Box::new(move |info| {
|
panic::set_hook(Box::new(move |info| {
|
||||||
if let Some(res) = info.payload().downcast_ref::<String>() {
|
if let Some(res) = info.payload().downcast_ref::<String>() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue