@@ -7,7 +7,7 @@ use super::{CatResult, FdReadable, InputHandle};
77use rustix:: io:: { read, write} ;
88use std:: os:: { fd:: AsFd , unix:: io:: AsRawFd } ;
99
10- use uucore:: pipes:: { MAX_ROOTLESS_PIPE_SIZE , pipe, splice, splice_exact} ;
10+ use uucore:: pipes:: { MAX_ROOTLESS_PIPE_SIZE , pipe, send_one_byte , splice, splice_exact} ;
1111
1212const BUF_SIZE : usize = 1024 * 16 ;
1313
@@ -30,15 +30,15 @@ pub(super) fn write_fast_using_splice<R: FdReadable, S: AsRawFd + AsFd>(
3030 loop {
3131 match splice ( & handle. reader , & write_fd, MAX_ROOTLESS_PIPE_SIZE ) {
3232 Ok ( 1 ..) => { }
33- Ok ( 0 ) => return Ok ( false ) ,
33+ Ok ( 0 ) => return Ok ( send_one_byte ( & handle . reader , & write_fd ) ) ,
3434 Err ( _) => return Ok ( true ) ,
3535 }
3636 }
3737 } else if let Ok ( ( pipe_rd, pipe_wr) ) = pipe ( ) {
3838 // both of in/output are not pipe. needs broker to use splice() with additional costs
3939 loop {
4040 match splice ( & handle. reader , & pipe_wr, MAX_ROOTLESS_PIPE_SIZE ) {
41- Ok ( 0 ) => return Ok ( false ) ,
41+ Ok ( 0 ) => return Ok ( send_one_byte ( & handle . reader , & write_fd ) ) ,
4242 Ok ( n) => {
4343 if splice_exact ( & pipe_rd, write_fd, n) . is_err ( ) {
4444 // If the first splice manages to copy to the intermediate
0 commit comments