Skip to content

Commit bdd71ec

Browse files
oech3cakebaker
authored andcommitted
pipes.rs: add missing count on fallback
1 parent db7b8a6 commit bdd71ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/uucore/src/lib/features/pipes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ pub fn send_n_bytes(input: impl AsFd, target: impl AsFd, n: u64) -> std::io::Res
207207
match splice(&input, &broker_w, n as usize) {
208208
Ok(0) => break might_fuse(&input),
209209
Ok(s) => {
210+
n -= s as u64;
211+
bytes_written += s as u64;
210212
if splice_exact(&broker_r, &target, s).is_ok() {
211-
n -= s as u64;
212-
bytes_written += s as u64;
213213
if n == 0 {
214214
// avoid unnecessary splice for small input
215215
break false;

0 commit comments

Comments
 (0)