Skip to content

Commit ad33937

Browse files
committed
tail: avoid unnecessary pipe2 syscall when stdout is already a pipe
Use splice_unbounded_auto instead of splice_unbounded_broker to avoid creating a broker pipe when stdout is already a pipe (e.g., when piping to another command with |).
1 parent d41c56b commit ad33937

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/uu/tail/src/tail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ fn print_target_section<
596596
}
597597
} else {
598598
#[cfg(any(target_os = "linux", target_os = "android"))]
599-
if uucore::pipes::splice_unbounded_broker(file, &mut stdout)?.is_err() {
599+
if uucore::pipes::splice_unbounded_auto(file, &mut stdout)? {
600600
io::copy(file, &mut stdout)?;
601601
}
602602
#[cfg(not(any(target_os = "linux", target_os = "android")))]

0 commit comments

Comments
 (0)