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"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getopts",
|
"getopts",
|
||||||
|
"libc",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"termion",
|
"termion",
|
||||||
|
@ -11,6 +11,7 @@ default = ["color"]
|
|||||||
color = ["termion"]
|
color = ["termion"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
libc = "0.2.148"
|
||||||
thiserror = "1.0.49"
|
thiserror = "1.0.49"
|
||||||
getopts = "0.2.21"
|
getopts = "0.2.21"
|
||||||
serde = { version = "1.0.188", features = ["derive"] }
|
serde = { version = "1.0.188", features = ["derive"] }
|
||||||
|
@ -558,6 +558,11 @@ fn execute(cli: Cli) -> Result<(), Error> {
|
|||||||
fn main() {
|
fn main() {
|
||||||
let cli = cli::parse();
|
let cli = cli::parse();
|
||||||
|
|
||||||
|
// suppress broken pipe error
|
||||||
|
unsafe {
|
||||||
|
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(e) = execute(cli) {
|
if let Err(e) = execute(cli) {
|
||||||
eprintln!("error: {}", e);
|
eprintln!("error: {}", e);
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user