File tree Expand file tree Collapse file tree
src/uucore/src/lib/features Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ mod tests {
5050 }
5151
5252 #[ test]
53- #[ cfg( unix ) ]
53+ #[ cfg( target_os = "linux" ) ]
5454 fn test_copy_stream ( ) {
5555 let mut dest_file = new_temp_file ( ) ;
5656
@@ -72,8 +72,8 @@ mod tests {
7272 }
7373
7474 #[ test]
75- #[ cfg( not( unix ) ) ]
76- // Test for non-unix platforms. We use regular files instead.
75+ #[ cfg( not( target_os = "linux" ) ) ]
76+ // Test for non-linux platforms. We use regular files instead.
7777 fn test_copy_stream ( ) {
7878 let temp_dir = tempdir ( ) . unwrap ( ) ;
7979 let src_path = temp_dir. path ( ) . join ( "src.txt" ) ;
Original file line number Diff line number Diff line change 77
88#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
99use rustix:: pipe:: { SpliceFlags , fcntl_setpipe_size} ;
10- #[ cfg( any( target_os = "linux" , target_os = "android" , test ) ) ]
10+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
1111use std:: fs:: File ;
1212#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
1313use std:: { io:: Read , os:: fd:: AsFd , sync:: OnceLock } ;
@@ -22,11 +22,10 @@ const KERNEL_DEFAULT_PIPE_SIZE: usize = 64 * 1024;
2222/// from the first.
2323/// used for resolving the limitation for splice: one of a input or output should be pipe
2424#[ inline]
25- #[ cfg( any( target_os = "linux" , target_os = "android" , test ) ) ]
25+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
2626pub fn pipe ( ) -> std:: io:: Result < ( File , File ) > {
2727 let ( read, write) = rustix:: pipe:: pipe ( ) ?;
2828 // improve performance for splice
29- #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
3029 let _ = fcntl_setpipe_size ( & read, MAX_ROOTLESS_PIPE_SIZE ) ;
3130
3231 Ok ( ( File :: from ( read) , File :: from ( write) ) )
You can’t perform that action at this time.
0 commit comments