Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/uu/install/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ uucore = { workspace = true, default-features = true, features = [
"perms",
"entries",
"process",
"signals",
] }
fluent = { workspace = true }

Expand Down
16 changes: 16 additions & 0 deletions src/uu/install/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ use uucore::selinux::{
SeLinuxError, contexts_differ, get_selinux_security_context, is_selinux_enabled,
selinux_error_description, set_selinux_security_context,
};
#[cfg(unix)]
use uucore::signals;
use uucore::translate;
use uucore::{format_usage, show, show_error, show_if_err};

Expand Down Expand Up @@ -168,12 +170,26 @@ static OPT_UNPRIVILEGED: &str = "unprivileged";

static ARG_FILES: &str = "files";

// Initialize SIGPIPE state capture at process startup (Unix only)
#[cfg(unix)]
uucore::init_sigpipe_capture!();

/// Main install utility function, called from main.rs.
///
/// Returns a program return code.
///
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
// Restore SIGPIPE to default if it wasn't explicitly ignored by parent.
// The Rust runtime ignores SIGPIPE, but we need to respect the parent's
// signal disposition for proper pipeline behavior (GNU compatibility).
#[cfg(unix)]
if !signals::sigpipe_was_ignored() {
// Ignore the return value: if setting signal handler fails, we continue anyway.
// The worst case is we don't get proper SIGPIPE behavior, but install will still work.
let _ = signals::enable_pipe_errors();
}

let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;

let paths: Vec<OsString> = matches
Expand Down
Loading