fix broken pipe panic

This commit is contained in:
Alexander Weiss 2022-11-26 08:17:17 +01:00
parent 222cb38c35
commit b60d28478b
3 changed files with 9 additions and 0 deletions

1
Cargo.lock generated
View File

@ -1732,6 +1732,7 @@ dependencies = [
"integer-sqrt",
"itertools",
"lazy_static",
"libc",
"log",
"merge",
"nix",

View File

@ -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"

View File

@ -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()
}