Skip to content

Commit a9cf501

Browse files
oech3cakebaker
authored andcommitted
tests_ls.rs: remove nix
1 parent db25551 commit a9cf501

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/by-util/test_ls.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
clippy::cast_possible_truncation
1111
)]
1212

13-
#[cfg(all(unix, feature = "chmod"))]
14-
use nix::unistd::{close, dup};
1513
use regex::Regex;
1614
#[cfg(unix)]
1715
use 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

0 commit comments

Comments
 (0)