diff options
author | Alan Somers <asomers@gmail.com> | 2018-11-21 12:25:23 -0700 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2018-11-23 11:41:47 -0700 |
commit | f7be5da1699b0860db50b7ab3613776d4c96ff70 (patch) | |
tree | a72d8f7e31592394aa2b94011fbb103e1e7c7ae9 /test | |
parent | 7db6fd46dc617824de12ad647a0f1bfbfbb3a799 (diff) | |
download | nix-f7be5da1699b0860db50b7ab3613776d4c96ff70.zip |
Fix unused warnings on FreeBSD from PR #952
Diffstat (limited to 'test')
-rw-r--r-- | test/test_unistd.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs index b03e8853..a4bb92eb 100644 --- a/test/test_unistd.rs +++ b/test/test_unistd.rs @@ -4,13 +4,12 @@ use nix::unistd::ForkResult::*; use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction}; use nix::sys::wait::*; use nix::sys::stat::{self, Mode, SFlag}; -use std::{env, iter, thread, time}; +use std::{env, iter}; use std::ffi::CString; -use std::fs::{self, File, metadata}; +use std::fs::{self, File}; use std::io::Write; use std::os::unix::prelude::*; -use std::process::Command; -use tempfile::{self, tempfile, NamedTempFile}; +use tempfile::{self, tempfile}; use libc::{self, _exit, off_t}; #[test] @@ -387,6 +386,10 @@ fn test_lseek64() { #[cfg(not(target_os = "freebsd"))] #[test] fn test_acct() { + use tempfile::NamedTempFile; + use std::process::Command; + use std::{thread, time}; + skip_if_not_root!("test_acct"); let file = NamedTempFile::new().unwrap(); let path = file.path().to_str().unwrap(); @@ -396,7 +399,7 @@ fn test_acct() { acct::disable().unwrap(); loop { - let len = metadata(path).unwrap().len(); + let len = fs::metadata(path).unwrap().len(); if len > 0 { break; } thread::sleep(time::Duration::from_millis(10)); } |