mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 11:36:16 +00:00
core: mute all BrokenPipe errors
On windows the error message does not contain `Broken pipe`, so let's try to find the error `kind` which should be `BrokenPipe` in all cases.
This commit is contained in:
parent
816c55dce4
commit
b87387964d
1 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,7 @@ 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>() {
|
||||||
if res.contains("Broken pipe") {
|
if res.contains("BrokenPipe") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue