From 83a5cd9522b6713de85d2c859d090de23f8e60d2 Mon Sep 17 00:00:00 2001 From: dragutreis <235304016+dragutreis@users.noreply.github.com> Date: Sun, 24 May 2026 06:10:26 -0500 Subject: [PATCH] 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 |). --- src/uu/tail/src/tail.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/tail/src/tail.rs b/src/uu/tail/src/tail.rs index f579c6a11..a9307d4cd 100644 --- a/src/uu/tail/src/tail.rs +++ b/src/uu/tail/src/tail.rs @@ -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")))]