summaryrefslogtreecommitdiff
path: root/test/test_unistd.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-06-12 17:40:02 -0600
committerGitHub <noreply@github.com>2021-06-12 17:40:02 -0600
commit4c15c53fc2c736a686307d46ff1db143a07711eb (patch)
tree10fb524ab8921d53567fe078bb5fd084faa114e7 /test/test_unistd.rs
parenta6405688352143d5a4b59368fad6218cefe7013d (diff)
parent221eac1e8f009041b5aeeb8736e29837d2f7776a (diff)
downloadnix-4c15c53fc2c736a686307d46ff1db143a07711eb.zip
Merge pull request #1451 from asomers/warns
Fix some warnings, and reenble tests that were broken on Travis
Diffstat (limited to 'test/test_unistd.rs')
-rw-r--r--test/test_unistd.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index 94d2d1b9..1609c853 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -1,6 +1,6 @@
#[cfg(not(target_os = "redox"))]
use nix::fcntl::{self, open, readlink};
-use nix::fcntl::{fcntl, FcntlArg, FdFlag, OFlag};
+use nix::fcntl::OFlag;
use nix::unistd::*;
use nix::unistd::ForkResult::*;
#[cfg(not(target_os = "redox"))]
@@ -13,14 +13,14 @@ use nix::errno::Errno;
#[cfg(not(target_os = "redox"))]
use nix::Error;
use std::{env, iter};
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
use std::ffi::CString;
#[cfg(not(target_os = "redox"))]
use std::fs::DirBuilder;
use std::fs::{self, File};
use std::io::Write;
use std::os::unix::prelude::*;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
use std::path::Path;
use tempfile::{tempdir, tempfile};
use libc::{_exit, mode_t, off_t};
@@ -135,6 +135,8 @@ fn test_mkfifoat_none() {
target_os = "macos", target_os = "ios",
target_os = "android", target_os = "redox")))]
fn test_mkfifoat() {
+ use nix::fcntl;
+
let tempdir = tempdir().unwrap();
let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap();
let mkfifoat_name = "mkfifoat_name";
@@ -258,7 +260,7 @@ fn test_initgroups() {
setgroups(&old_groups).unwrap();
}
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
macro_rules! execve_test_factory(
($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => (
@@ -669,6 +671,8 @@ fn test_pipe() {
target_os = "solaris"))]
#[test]
fn test_pipe2() {
+ use nix::fcntl::{fcntl, FcntlArg, FdFlag};
+
let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap();
let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap());
assert!(f0.contains(FdFlag::FD_CLOEXEC));