File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,11 +119,11 @@ pub fn exec(mut bytes: Vec<u8>) -> io::Result<()> {
119119 repeat_content_to_capacity ( & mut bytes) ;
120120 let bytes = bytes. as_slice ( ) ;
121121 let mut stdout = io:: stdout ( ) ; // no need to lock with zero-copy
122+ // improve throughput
123+ let _ = rustix:: pipe:: fcntl_setpipe_size ( & stdout, MAX_ROOTLESS_PIPE_SIZE ) ;
122124 // don't show any error from fast-path and fallback to write for proper message
123125 if let Ok ( ( p_read, mut p_write) ) = pipe ( )
124- // todo: zero-copy with default size when fcntl failed
125- && rustix:: pipe:: fcntl_setpipe_size ( & stdout, MAX_ROOTLESS_PIPE_SIZE ) . is_ok ( )
126- && p_write. write_all ( bytes) . is_ok ( )
126+ && p_write. write_all ( bytes) . is_ok ( )
127127 {
128128 if aligned && tee ( & p_read, & stdout, MAX_ROOTLESS_PIPE_SIZE ) . is_ok ( ) {
129129 while let Ok ( 1 ..) = tee ( & p_read, & stdout, MAX_ROOTLESS_PIPE_SIZE ) { }
You can’t perform that action at this time.
0 commit comments