Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9306ea6
refactor(cp): replace println! with write_stdout_line for robust erro…
mattsu2020 Dec 29, 2025
96637b9
fix(uucore): handle stdout flush errors by ignoring BrokenPipe and ad…
mattsu2020 Dec 29, 2025
771bdf7
fix: ignore stdout flush errors when stdout was already closed
mattsu2020 Dec 29, 2025
11076ef
refactor(lib): simplify stdout flush error handling in bin! macro
mattsu2020 Dec 29, 2025
58e0517
refactor: extract stdout closure detection into utility functions
mattsu2020 Dec 29, 2025
032bce5
refactor(lib): sort nix::fcntl imports alphabetically in stdout_is_cl…
mattsu2020 Dec 29, 2025
859cb36
feat(uucore): add stdout write checking and tracking
mattsu2020 Dec 29, 2025
6f57eb6
refactor(uucore): format cfg_attr and variable assignment for readabi…
mattsu2020 Dec 29, 2025
697b4fe
feat(display): add stdout write check in print_all_env_vars
mattsu2020 Dec 29, 2025
e7f32bc
mktemp: drop unrelated refactor from this branch
mattsu2020 Dec 29, 2025
0ddeb76
docs: clarify stdout check comment in print_all_env_vars
mattsu2020 Dec 29, 2025
72bc9c5
feat(cp,printf): add stdout state tracking to handle closed stdout
mattsu2020 Jan 14, 2026
d866818
chore(spell-checker): add 'devnull' to ignore lists in cp and printf
mattsu2020 Jan 14, 2026
ec99d94
chore(fuzz): update Rust dependencies
mattsu2020 Jan 14, 2026
bf227bd
style: format io::Error::new in cp and printf stdout_state for better…
mattsu2020 Jan 14, 2026
f22add1
Merge branch 'main' into misc/close-stdout.sh
mattsu2020 Jan 26, 2026
667a10a
test: add tests for stdout failure handling in cp and printf
mattsu2020 Jan 26, 2026
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 54 additions & 35 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/uu/cp/src/copydir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use walkdir::{DirEntry, WalkDir};

use crate::{
CopyMode, CopyResult, CpError, Options, aligned_ancestors, context_for, copy_attributes,
copy_file,
copy_file, write_stdout_line,
};

/// Ensure a Windows path starts with a `\\?`.
Expand Down Expand Up @@ -271,10 +271,10 @@ fn copy_direntry(
Some(&entry.source_absolute),
)?;
if options.verbose {
println!(
write_stdout_line(format_args!(
"{}",
context_for(&entry.source_relative, &entry.local_to_target)
);
))?;
}
Ok(())
};
Expand Down Expand Up @@ -392,7 +392,7 @@ pub(crate) fn copy_directory(
// a/b -> d/a/b
//
for (x, y) in aligned_ancestors(root, &target.join(root)) {
println!("{} -> {}", x.display(), y.display());
write_stdout_line(format_args!("{} -> {}", x.display(), y.display()))?;
}
}

Expand Down
Loading
Loading