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 |).
This commit is contained in:
dragutreis
2026-05-26 14:00:10 +02:00
committed by Dorian Péron
parent 259813f9e9
commit 83a5cd9522
+1 -1
View File
@@ -596,7 +596,7 @@ fn print_target_section<
}
} else {
#[cfg(any(target_os = "linux", target_os = "android"))]
if uucore::pipes::splice_unbounded_broker(file, &mut stdout)?.is_err() {
if uucore::pipes::splice_unbounded_auto(file, &mut stdout)? {
io::copy(file, &mut stdout)?;
}
#[cfg(not(any(target_os = "linux", target_os = "android")))]