File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 clippy:: cast_possible_truncation
1111) ]
1212
13- #[ cfg( all( unix, feature = "chmod" ) ) ]
14- use nix:: unistd:: { close, dup} ;
1513use regex:: Regex ;
1614#[ cfg( unix) ]
1715use rlimit:: Resource ;
@@ -599,8 +597,8 @@ fn test_ls_io_errors() {
599597
600598 at. touch ( "some-dir4/bad-fd.txt" ) ;
601599 let fd1 = at. open ( "some-dir4/bad-fd.txt" ) ;
602- let fd2 = dup ( dbg ! ( & fd1) ) . unwrap ( ) ;
603- close ( fd1) . unwrap ( ) ;
600+ let fd2 = rustix :: io :: dup ( dbg ! ( & fd1) ) . unwrap ( ) ;
601+ drop ( fd1) ; //close
604602
605603 // on the mac and in certain Linux containers bad fds are typed as dirs,
606604 // however sometimes bad fds are typed as links and directory entry on links won't fail
@@ -644,7 +642,7 @@ fn test_ls_io_errors() {
644642 . arg ( format ! ( "/dev/fd/{}" , fd2. as_raw_fd( ) ) )
645643 . succeeds ( ) ;
646644
647- let _ = close ( fd2) ;
645+ drop ( fd2) ; //close
648646 }
649647}
650648
You can’t perform that action at this time.
0 commit comments