mirror of
https://git.mentality.rip/numas13/xash3d-master.git
synced 2025-01-22 12:54:24 +00:00
query: suppress broken pipe error
This commit is contained in:
parent
62fe4d0b6c
commit
ca2aef3326
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -510,6 +510,7 @@ name = "xash3d-query"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"getopts",
|
||||
"libc",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"termion",
|
||||
|
@ -11,6 +11,7 @@ default = ["color"]
|
||||
color = ["termion"]
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2.148"
|
||||
thiserror = "1.0.49"
|
||||
getopts = "0.2.21"
|
||||
serde = { version = "1.0.188", features = ["derive"] }
|
||||
|
@ -558,6 +558,11 @@ fn execute(cli: Cli) -> Result<(), Error> {
|
||||
fn main() {
|
||||
let cli = cli::parse();
|
||||
|
||||
// suppress broken pipe error
|
||||
unsafe {
|
||||
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||
}
|
||||
|
||||
if let Err(e) = execute(cli) {
|
||||
eprintln!("error: {}", e);
|
||||
process::exit(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user