From 51be2c98526d598fededbe96f130d482964a275f Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Mon, 15 Aug 2016 21:13:26 +0200 Subject: [PATCH] Get rid of a few warnings during compilation of tests --- test/test_mount.rs | 6 +++--- test/test_signalfd.rs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_mount.rs b/test/test_mount.rs index 74d2938cbe..7ddbce9fcb 100644 --- a/test/test_mount.rs +++ b/test/test_mount.rs @@ -15,7 +15,7 @@ mod test_mount { use std::os::unix::fs::PermissionsExt; use std::process::{self, Command}; - use libc::{self, EACCES, EROFS}; + use libc::{EACCES, EROFS}; use nix::mount::{mount, umount, MsFlags, MS_BIND, MS_RDONLY, MS_NOEXEC}; use nix::sched::{unshare, CLONE_NEWNS, CLONE_NEWUSER}; @@ -179,8 +179,8 @@ exit 23"; let mut handle = stderr.lock(); writeln!(handle, "unshare failed: {}. Are unprivileged user namespaces available?", - e); - writeln!(handle, "mount is not being tested"); + e).unwrap(); + writeln!(handle, "mount is not being tested").unwrap(); // Exit with success because not all systems support unprivileged user namespaces, and // that's not what we're testing for. process::exit(0); diff --git a/test/test_signalfd.rs b/test/test_signalfd.rs index 8bb62bb207..28a6decb9e 100644 --- a/test/test_signalfd.rs +++ b/test/test_signalfd.rs @@ -1,9 +1,10 @@ extern crate nix; #[cfg(feature = "signalfd")] - use nix::sys::signalfd::SignalFd; +#[cfg(feature = "signalfd")] use nix::sys::signal; +#[cfg(feature = "signalfd")] use nix::unistd; #[cfg(feature = "signalfd")]