mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #10113 from sylvestre/signal-2
use the enable_pipe_errors instead of libc::signal
This commit is contained in:
@@ -21,7 +21,7 @@ path = "src/cat.rs"
|
||||
clap = { workspace = true }
|
||||
memchr = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
uucore = { workspace = true, features = ["fast-inc", "fs", "pipes"] }
|
||||
uucore = { workspace = true, features = ["fast-inc", "fs", "pipes", "signals"] }
|
||||
fluent = { workspace = true }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
|
||||
@@ -20,8 +20,6 @@ use std::os::unix::fs::FileTypeExt;
|
||||
use thiserror::Error;
|
||||
use uucore::display::Quotable;
|
||||
use uucore::error::UResult;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use uucore::libc;
|
||||
use uucore::translate;
|
||||
use uucore::{fast_inc::fast_inc_one, format_usage};
|
||||
|
||||
@@ -225,9 +223,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
// (see https://github.com/rust-lang/rust/issues/62569), so we restore it's
|
||||
// default action here.
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
unsafe {
|
||||
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||
}
|
||||
let _ = uucore::signals::enable_pipe_errors();
|
||||
|
||||
let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
|
||||
|
||||
|
||||
Vendored
+1
-3
@@ -1098,9 +1098,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
// Rust ignores SIGPIPE (see https://github.com/rust-lang/rust/issues/62569).
|
||||
// We restore its default action here.
|
||||
#[cfg(unix)]
|
||||
unsafe {
|
||||
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||
}
|
||||
let _ = uucore::signals::enable_pipe_errors();
|
||||
EnvAppData::default().run_env(args)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ clap = { workspace = true }
|
||||
libc = { workspace = true }
|
||||
memchr = { workspace = true }
|
||||
notify = { workspace = true }
|
||||
uucore = { workspace = true, features = ["fs", "parser-size"] }
|
||||
uucore = { workspace = true, features = ["fs", "parser-size", "signals"] }
|
||||
same-file = { workspace = true }
|
||||
fluent = { workspace = true }
|
||||
|
||||
|
||||
@@ -45,9 +45,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
// (see https://github.com/rust-lang/rust/issues/62569), so we restore it's
|
||||
// default action here.
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
unsafe {
|
||||
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||
}
|
||||
let _ = uucore::signals::enable_pipe_errors();
|
||||
|
||||
let settings = parse_args(args)?;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ path = "src/tr.rs"
|
||||
[dependencies]
|
||||
nom = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
uucore = { workspace = true, features = ["fs"] }
|
||||
uucore = { workspace = true, features = ["fs", "signals"] }
|
||||
fluent = { workspace = true }
|
||||
bytecount = { workspace = true, features = ["runtime-dispatch-simd"] }
|
||||
|
||||
|
||||
+1
-5
@@ -18,8 +18,6 @@ use std::io::{stdin, stdout};
|
||||
use uucore::display::Quotable;
|
||||
use uucore::error::{UResult, USimpleError, UUsageError};
|
||||
use uucore::fs::is_stdin_directory;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use uucore::libc;
|
||||
use uucore::translate;
|
||||
use uucore::{format_usage, os_str_as_bytes, show};
|
||||
|
||||
@@ -38,9 +36,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
// (see https://github.com/rust-lang/rust/issues/62569), so we restore it's
|
||||
// default action here.
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
unsafe {
|
||||
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||
}
|
||||
let _ = uucore::signals::enable_pipe_errors();
|
||||
|
||||
let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user