Skip to content

Commit 3405a7c

Browse files
committed
Fix some unused import warnings in the tests
1 parent 37e0c10 commit 3405a7c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/test_unistd.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[cfg(not(target_os = "redox"))]
22
use nix::fcntl::{self, open, readlink};
3-
use nix::fcntl::{fcntl, FcntlArg, FdFlag, OFlag};
3+
use nix::fcntl::OFlag;
44
use nix::unistd::*;
55
use nix::unistd::ForkResult::*;
66
#[cfg(not(target_os = "redox"))]
@@ -13,14 +13,14 @@ use nix::errno::Errno;
1313
#[cfg(not(target_os = "redox"))]
1414
use nix::Error;
1515
use std::{env, iter};
16-
#[cfg(not(target_os = "redox"))]
16+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
1717
use std::ffi::CString;
1818
#[cfg(not(target_os = "redox"))]
1919
use std::fs::DirBuilder;
2020
use std::fs::{self, File};
2121
use std::io::Write;
2222
use std::os::unix::prelude::*;
23-
#[cfg(not(target_os = "redox"))]
23+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
2424
use std::path::Path;
2525
use tempfile::{tempdir, tempfile};
2626
use libc::{_exit, mode_t, off_t};
@@ -135,6 +135,8 @@ fn test_mkfifoat_none() {
135135
target_os = "macos", target_os = "ios",
136136
target_os = "android", target_os = "redox")))]
137137
fn test_mkfifoat() {
138+
use nix::fcntl;
139+
138140
let tempdir = tempdir().unwrap();
139141
let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
140142
let mkfifoat_name = "mkfifoat_name";
@@ -258,7 +260,7 @@ fn test_initgroups() {
258260
setgroups(&old_groups).unwrap();
259261
}
260262

261-
#[cfg(not(target_os = "redox"))]
263+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
262264
macro_rules! execve_test_factory(
263265
($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => (
264266

@@ -669,6 +671,8 @@ fn test_pipe() {
669671
target_os = "solaris"))]
670672
#[test]
671673
fn test_pipe2() {
674+
use nix::fcntl::{fcntl, FcntlArg, FdFlag};
675+
672676
let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap();
673677
let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap());
674678
assert!(f0.contains(FdFlag::FD_CLOEXEC));

0 commit comments

Comments
 (0)