Skip to content

Commit

Permalink
Fix unused warnings on FreeBSD from PR nix-rust#952
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Nov 21, 2018
1 parent 83ff69e commit 7d9a679
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/test_unistd.rs
Expand Up @@ -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]
Expand Down Expand Up @@ -384,6 +383,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();
Expand All @@ -393,7 +396,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));
}
Expand Down

0 comments on commit 7d9a679

Please sign in to comment.