mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 14:52:41 +00:00
Merge pull request #5508 from cakebaker/cp_fix_test_closes_file_descriptors
cp: make test_closes_file_descriptors Linux-only
This commit is contained in:
commit
1cae4981e6
1 changed files with 2 additions and 4 deletions
|
@ -24,8 +24,6 @@ use std::path::PathBuf;
|
|||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
use filetime::FileTime;
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
use rlimit::Resource;
|
||||
#[cfg(target_os = "linux")]
|
||||
use std::ffi::OsString;
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
|
@ -2120,10 +2118,11 @@ fn test_cp_reflink_insufficient_permission() {
|
|||
.stderr_only("cp: 'unreadable' -> 'existing_file.txt': Permission denied (os error 13)\n");
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn test_closes_file_descriptors() {
|
||||
use procfs::process::Process;
|
||||
use rlimit::Resource;
|
||||
let me = Process::myself().unwrap();
|
||||
|
||||
// The test suite runs in parallel, we have pipe, sockets
|
||||
|
@ -2133,7 +2132,6 @@ fn test_closes_file_descriptors() {
|
|||
let limit_fd: u64 = number_file_already_opened + 9;
|
||||
|
||||
// For debugging purposes:
|
||||
#[cfg(not(target_os = "android"))]
|
||||
for f in me.fd().unwrap() {
|
||||
let fd = f.unwrap();
|
||||
println!("{:?} {:?}", fd, fd.mode());
|
||||
|
|
Loading…
Reference in a new issue