From: Ian Jackson Date: Sun, 8 Aug 2021 00:48:36 +0000 (+0100) Subject: Revert "ipif: Do not grumble about ipif getting sigpipe, if we are quitting" X-Git-Tag: hippotat/1.0.0~235 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=34ed326796ff4d8b96f8ef85e3ce1a0a9196c1e9;p=hippotat.git Revert "ipif: Do not grumble about ipif getting sigpipe, if we are quitting" This reverts commit ceb9a34ac113484065b5bcbb1b6dccf263e1a42b. --- diff --git a/src/ipif.rs b/src/ipif.rs index 9b57086..5364e37 100644 --- a/src/ipif.rs +++ b/src/ipif.rs @@ -61,20 +61,7 @@ impl Ipif { Ok(Ok(Err(e))) => error!("{}ipif stderr read failed: {}", icd, e), Ok(Ok(Ok(()))) => { }, } - - fn is_sigpipe(st: ExitStatus) -> bool { - #[cfg(unix)] { - use std::os::unix::process::ExitStatusExt; - const SIGPIPE: i32 = 13; - if st.code() == Some(SIGPIPE+128) { return true } - if st.signal() == Some(SIGPIPE) { return true } - } - false - } - if st.success() { - } else if is_sigpipe(st) { - debug!("{}ipif process got SIGPIPE: {}", icd, st); - } else { + if ! st.success() { error!("{}ipif process failed: {}", icd, st); } } diff --git a/src/prelude.rs b/src/prelude.rs index beab58f..c0516d2 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -17,7 +17,7 @@ pub use std::mem; pub use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; pub use std::path::{Path, PathBuf}; pub use std::panic; -pub use std::process::{self, ExitStatus}; +pub use std::process; pub use std::pin::Pin; pub use std::str::{self, FromStr}; pub use std::sync::Arc;