Skip to content

Commit 3af25ae

Browse files
oech3sylvestre
authored andcommitted
yes: fix confusing 1.. and comment
1 parent dddf0a3 commit 3af25ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/uu/yes/src/yes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ pub fn exec(mut bytes: Vec<u8>) -> io::Result<()> {
120120
if let Ok((p_read, mut p_write)) = pipe::<true>(MAX_ROOTLESS_PIPE_SIZE)
121121
&& p_write.write_all(bytes).is_ok()
122122
{
123+
// tee() cannot control offset. Check that output is pipe by tee
123124
if safe_partial_send && tee(&p_read, &stdout, MAX_ROOTLESS_PIPE_SIZE).is_ok() {
124-
while let Ok(1..) = tee(&p_read, &stdout, MAX_ROOTLESS_PIPE_SIZE) {}
125+
while tee(&p_read, &stdout, MAX_ROOTLESS_PIPE_SIZE).is_ok() {}
125126
} else if let Ok((broker_read, broker_write)) = pipe::<true>(MAX_ROOTLESS_PIPE_SIZE) {
126-
// tee() cannot control offset and write to non-pipe
127127
'hybrid: while let Ok(mut remain) = tee(&p_read, &broker_write, MAX_ROOTLESS_PIPE_SIZE)
128128
{
129129
debug_assert!(remain == bytes.len(), "splice() should cleanup pipe");

0 commit comments

Comments
 (0)