8000 cp: make test_closes_file_descriptors Linux-only by cakebaker · Pull Request #5508 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cp: make test_closes_file_descriptors Linux-only #5508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/by-util/test_cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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
Expand All @@ -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());
Expand Down
0