From 0b04f5ec69b55c30f6be63a032e7ad51fb37036e Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 12 May 2026 18:47:12 +0900 Subject: [PATCH] yes: fix wrong assumption for stdout (#12249) --- src/uu/yes/src/yes.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uu/yes/src/yes.rs b/src/uu/yes/src/yes.rs index 825197f94..22508a1b2 100644 --- a/src/uu/yes/src/yes.rs +++ b/src/uu/yes/src/yes.rs @@ -119,11 +119,11 @@ pub fn exec(mut bytes: Vec) -> io::Result<()> { repeat_content_to_capacity(&mut bytes); let bytes = bytes.as_slice(); let mut stdout = io::stdout(); // no need to lock with zero-copy + // improve throughput + let _ = rustix::pipe::fcntl_setpipe_size(&stdout, MAX_ROOTLESS_PIPE_SIZE); // don't show any error from fast-path and fallback to write for proper message if let Ok((p_read, mut p_write)) = pipe() - // todo: zero-copy with default size when fcntl failed - && rustix::pipe::fcntl_setpipe_size(&stdout, MAX_ROOTLESS_PIPE_SIZE).is_ok() - && p_write.write_all(bytes).is_ok() + && p_write.write_all(bytes).is_ok() { if aligned && tee(&p_read, &stdout, MAX_ROOTLESS_PIPE_SIZE).is_ok() { while let Ok(1..) = tee(&p_read, &stdout, MAX_ROOTLESS_PIPE_SIZE) {}