mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Handle SIGPIPE (#5444)
This commit is contained in:
parent
9ce40cb91f
commit
3ab131c22c
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -2245,6 +2245,15 @@ version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||
|
||||
[[package]]
|
||||
name = "sigpipe"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5584bfb3e0d348139d8210285e39f6d2f8a1902ac06de343e06357d1d763d8e6"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simd-adler32"
|
||||
version = "0.3.7"
|
||||
@ -2705,6 +2714,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"serde_yaml 0.9.34+deprecated",
|
||||
"shell-escape",
|
||||
"sigpipe",
|
||||
"tar",
|
||||
"tempfile",
|
||||
"toml",
|
||||
|
@ -104,6 +104,7 @@ serde = { version = "1.0.184", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
serde_yaml = "0.9"
|
||||
shell-escape = "0.1.5"
|
||||
sigpipe = "0.1"
|
||||
siphasher = "1"
|
||||
smallvec = { version = "1.11.1", features = ["union", "const_generics", "const_new"] }
|
||||
stacker = "0.1.15"
|
||||
|
@ -46,6 +46,7 @@ serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
serde_yaml = { workspace = true }
|
||||
shell-escape = { workspace = true }
|
||||
sigpipe = { workspace = true }
|
||||
tar = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
toml = { workspace = true }
|
||||
|
@ -44,6 +44,10 @@ static ARGS: LazyLock<CliArguments> = LazyLock::new(|| {
|
||||
|
||||
/// Entry point.
|
||||
fn main() -> ExitCode {
|
||||
// Handle SIGPIPE
|
||||
// https://stackoverflow.com/questions/65755853/simple-word-count-rust-program-outputs-valid-stdout-but-panicks-when-piped-to-he/65760807
|
||||
sigpipe::reset();
|
||||
|
||||
let res = dispatch();
|
||||
|
||||
if let Err(msg) = res {
|
||||
|
Loading…
x
Reference in New Issue
Block a user