Skip to content

Commit 000dd61

Browse files
committed
fix(yes): restore SIGPIPE to default handler
Fixes broken pipe handling by unconditionally restoring SIGPIPE to SIG_DFL at program startup, following the established pattern used in cat, tr, and tail utilities. This ensures the process properly terminates with exit code 141 when writing to closed pipes, rather than ignoring SIGPIPE as Rust does by default. Related to issue #7252 and PR #9560.
1 parent e2925fd commit 000dd61

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/uu/stty/src/stty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ fn apply_char_mapping(termios: &mut Termios, mapping: &(S, u8)) {
997997
///
998998
/// The state array contains:
999999
/// - `state[0]`: input flags
1000-
/// - `state[1]`: output flags
1000+
/// - `state[1]`: output flags
10011001
/// - `state[2]`: control flags
10021002
/// - `state[3]`: local flags
10031003
/// - `state[4..]`: control characters (optional)

tests/by-util/test_ls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6498,7 +6498,7 @@ fn test_f_overrides_sort_flags() {
64986498

64996499
// Create files with different sizes for predictable sort order
65006500
at.write("small.txt", "a"); // 1 byte
6501-
at.write("medium.txt", "bb"); // 2 bytes
6501+
at.write("medium.txt", "bb"); // 2 bytes
65026502
at.write("large.txt", "ccc"); // 3 bytes
65036503

65046504
// Get baseline outputs (include -a to match -f behavior which shows all files)

0 commit comments

Comments
 (0)