diff --git a/Cargo.lock b/Cargo.lock index 21c78a7..cccfa56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1732,6 +1732,7 @@ dependencies = [ "integer-sqrt", "itertools", "lazy_static", + "libc", "log", "merge", "nix", diff --git a/Cargo.toml b/Cargo.toml index aaa52ba..18db94c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,6 +86,7 @@ users = "0.11" itertools = "0.10" simplelog = "0.12" comfy-table = "6.1.2" +libc="0.2" [dev-dependencies] rstest = "0.15" diff --git a/src/main.rs b/src/main.rs index 729d28d..433fbb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,5 +41,12 @@ mod index; mod repo; fn main() -> Result<()> { + // this is a workaround until unix_sigpipe (https://github.com/rust-lang/rust/issues/97889) is available. + // See also https://github.com/rust-lang/rust/issues/46016 + #[allow(unsafe_code)] + unsafe { + libc::signal(libc::SIGPIPE, libc::SIG_DFL); + } + commands::execute() }