@@ -476,31 +476,25 @@ fn get_input_type(path: &OsString) -> CatResult<InputType> {
476476/// Writes handle to stdout with no configuration. This allows a
477477/// simple memory copy.
478478fn print_fast < R : FdReadable > ( handle : & mut InputHandle < R > ) -> CatResult < ( ) > {
479- let stdout = io:: stdout ( ) ;
480- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
481- let mut stdout = stdout;
482479 // Try to use the splice() system call for faster writing. If it works, we're done.
483480 #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
484- if uucore:: pipes:: splice_unbounded_auto ( & handle. reader , & mut stdout ) ?. is_ok ( )
481+ if uucore:: pipes:: splice_unbounded_auto ( & handle. reader , & mut * uucore :: stdio :: stdout_raw ( ) ) ?. is_ok ( )
485482 && !uucore:: pipes:: might_fuse ( & handle. reader )
486483 {
487484 return Ok ( ( ) ) ;
488485 }
489486
490487 // If we're not on Linux or Android, or the splice() call failed,
491488 // fall back on slower writing.
492- print_unbuffered ( handle, stdout )
489+ print_unbuffered ( handle)
493490}
494491
495492#[ cfg_attr( any( target_os = "linux" , target_os = "android" ) , inline( never) ) ] // splice fast-path does not require this allocation
496- fn print_unbuffered < R : FdReadable > (
497- handle : & mut InputHandle < R > ,
498- stdout : io:: Stdout ,
499- ) -> CatResult < ( ) > {
493+ fn print_unbuffered < R : FdReadable > ( handle : & mut InputHandle < R > ) -> CatResult < ( ) > {
500494 #[ cfg( any( unix, target_os = "wasi" ) ) ]
501- let mut stdout = uucore:: io :: RawWriter ( stdout ) ; // use raw syscall to remove buffering
495+ let mut stdout = uucore:: stdio :: stdout_raw ( ) ;
502496 #[ cfg( not( any( unix, target_os = "wasi" ) ) ) ]
503- let mut stdout = stdout. lock ( ) ;
497+ let mut stdout = io :: stdout ( ) . lock ( ) ;
504498 let mut buf = [ 0 ; 1024 * 64 ] ;
505499 loop {
506500 match handle. reader . read ( & mut buf) {
0 commit comments