Skip to content

Commit 761213f

Browse files
committed
cp: make test_closes_file_descriptors Linux-only
1 parent 4a3efad commit 761213f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/by-util/test_cp.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ use std::path::PathBuf;
2424

2525
#[cfg(any(target_os = "linux", target_os = "android"))]
2626
use filetime::FileTime;
27-
#[cfg(any(target_os = "linux", target_os = "android"))]
28-
use rlimit::Resource;
2927
#[cfg(target_os = "linux")]
3028
use std::ffi::OsString;
3129
#[cfg(any(target_os = "linux", target_os = "android"))]
@@ -2120,10 +2118,11 @@ fn test_cp_reflink_insufficient_permission() {
21202118
.stderr_only("cp: 'unreadable' -> 'existing_file.txt': Permission denied (os error 13)\n");
21212119
}
21222120

2123-
#[cfg(any(target_os = "linux", target_os = "android"))]
2121+
#[cfg(target_os = "linux")]
21242122
#[test]
21252123
fn test_closes_file_descriptors() {
21262124
use procfs::process::Process;
2125+
use rlimit::Resource;
21272126
let me = Process::myself().unwrap();
21282127

21292128
// The test suite runs in parallel, we have pipe, sockets
@@ -2133,7 +2132,6 @@ fn test_closes_file_descriptors() {
21332132
let limit_fd: u64 = number_file_already_opened + 9;
21342133

21352134
// For debugging purposes:
2136-
#[cfg(not(target_os = "android"))]
21372135
for f in me.fd().unwrap() {
21382136
let fd = f.unwrap();
21392137
println!("{:?} {:?}", fd, fd.mode());

0 commit comments

Comments
 (0)