@@ -256,26 +256,25 @@ mod linux_only {
256256 use uutests:: util:: { AtPath , CmdResult , UCommand } ;
257257
258258 use std:: fmt:: Write ;
259- use std:: fs:: File ;
260259 use std:: process:: Stdio ;
261260 use std:: time:: Duration ;
262261 use uutests:: at_and_ucmd;
263262 use uutests:: new_ucmd;
264263
265- fn make_broken_pipe ( ) -> File {
266- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
264+ fn make_broken_pipe ( ) -> std :: io :: PipeWriter {
265+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
267266 // Drop the read end of the pipe
268267 drop ( read) ;
269- // Make the write end of the pipe into a Rust File
270- write. into ( )
268+ // Return the write end of the pipe
269+ write
271270 }
272271
273- fn make_hanging_read ( ) -> File {
274- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
272+ fn make_hanging_read ( ) -> std :: io :: PipeReader {
273+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
275274 // PURPOSELY leak the write end of the pipe, so the read end hangs.
276275 std:: mem:: forget ( write) ;
277276 // Return the read end of the pipe
278- read. into ( )
277+ read
279278 }
280279
281280 fn run_tee ( proc : & mut UCommand ) -> ( String , CmdResult ) {
@@ -726,10 +725,9 @@ fn test_output_error_flag_without_value_defaults_warn_nopipe() {
726725#[ cfg( all( unix, not( target_os = "freebsd" ) ) ) ]
727726#[ test]
728727fn test_output_error_presence_only_broken_pipe_unix ( ) {
729- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
728+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
730729 // Close the read end to simulate a broken pipe on stdout
731730 drop ( read) ;
732- let write: std:: fs:: File = write. into ( ) ;
733731 let content = ( 0 ..10_000 ) . map ( |_| "x" ) . collect :: < String > ( ) ;
734732 let result = new_ucmd ! ( )
735733 . arg ( "--output-error" ) // presence-only flag
@@ -745,10 +743,9 @@ fn test_output_error_presence_only_broken_pipe_unix() {
745743#[ cfg( all( unix, not( target_os = "freebsd" ) ) ) ]
746744#[ test]
747745fn test_broken_pipe_early_termination_stdout_only ( ) {
748- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
746+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
749747 // Create a broken stdout
750748 drop ( read) ;
751- let write: std:: fs:: File = write. into ( ) ;
752749 let content = ( 0 ..10_000 ) . map ( |_| "x" ) . collect :: < String > ( ) ;
753750 let mut proc = new_ucmd ! ( ) ;
754751 let result = proc
0 commit comments