mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
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:
@@ -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")))]
|
||||
|
||||
Reference in New Issue
Block a user