summaryrefslogtreecommitdiff
path: root/test/sys
diff options
context:
space:
mode:
Diffstat (limited to 'test/sys')
-rw-r--r--test/sys/test_aio.rs6
-rw-r--r--test/sys/test_signal.rs3
-rw-r--r--test/sys/test_signalfd.rs3
-rw-r--r--test/sys/test_termios.rs9
-rw-r--r--test/sys/test_uio.rs3
-rw-r--r--test/sys/test_wait.rs9
6 files changed, 11 insertions, 22 deletions
diff --git a/test/sys/test_aio.rs b/test/sys/test_aio.rs
index 48399fbd..d4b09b0b 100644
--- a/test/sys/test_aio.rs
+++ b/test/sys/test_aio.rs
@@ -441,8 +441,7 @@ extern fn sigfunc(_: c_int) {
#[test]
#[cfg_attr(any(all(target_env = "musl", target_arch = "x86_64"), target_arch = "mips", target_arch = "mips64"), ignore)]
fn test_write_sigev_signal() {
- #[allow(unused_variables)]
- let m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
let sa = SigAction::new(SigHandler::Handler(sigfunc),
SaFlags::SA_RESETHAND,
SigSet::empty());
@@ -580,8 +579,7 @@ fn test_liocb_listio_nowait() {
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
#[cfg_attr(any(target_arch = "mips", target_arch = "mips64", target_env = "musl"), ignore)]
fn test_liocb_listio_signal() {
- #[allow(unused_variables)]
- let m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
const INITIAL: &[u8] = b"abcdef123456";
const WBUF: &[u8] = b"CDEF";
let mut rbuf = vec![0; 4];
diff --git a/test/sys/test_signal.rs b/test/sys/test_signal.rs
index 7d3a9bf2..c8dd9776 100644
--- a/test/sys/test_signal.rs
+++ b/test/sys/test_signal.rs
@@ -28,8 +28,7 @@ fn test_sigprocmask_noop() {
#[test]
fn test_sigprocmask() {
- #[allow(unused_variables)]
- let m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
// This needs to be a signal that rust doesn't use in the test harness.
const SIGNAL: Signal = Signal::SIGCHLD;
diff --git a/test/sys/test_signalfd.rs b/test/sys/test_signalfd.rs
index a2f8fd8f..a3b60988 100644
--- a/test/sys/test_signalfd.rs
+++ b/test/sys/test_signalfd.rs
@@ -4,8 +4,7 @@ fn test_signalfd() {
use nix::sys::signal::{self, raise, Signal, SigSet};
// Grab the mutex for altering signals so we don't interfere with other tests.
- #[allow(unused_variables)]
- let m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test");
// Block the SIGUSR1 signal from automatic processing for this thread
let mut mask = SigSet::empty();
diff --git a/test/sys/test_termios.rs b/test/sys/test_termios.rs
index 831fc18b..a14b8ce1 100644
--- a/test/sys/test_termios.rs
+++ b/test/sys/test_termios.rs
@@ -19,8 +19,7 @@ fn write_all(f: RawFd, buf: &[u8]) {
#[test]
fn test_tcgetattr_pty() {
// openpty uses ptname(3) internally
- #[allow(unused_variables)]
- let m = ::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
let pty = openpty(None, None).expect("openpty failed");
assert!(termios::tcgetattr(pty.master).is_ok());
@@ -47,8 +46,7 @@ fn test_tcgetattr_ebadf() {
#[test]
fn test_output_flags() {
// openpty uses ptname(3) internally
- #[allow(unused_variables)]
- let m = ::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
// Open one pty to get attributes for the second one
let mut termios = {
@@ -90,8 +88,7 @@ fn test_output_flags() {
#[test]
fn test_local_flags() {
// openpty uses ptname(3) internally
- #[allow(unused_variables)]
- let m = ::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test");
// Open one pty to get attributes for the second one
let mut termios = {
diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs
index 727194d5..3e4fc28c 100644
--- a/test/sys/test_uio.rs
+++ b/test/sys/test_uio.rs
@@ -200,8 +200,7 @@ fn test_process_vm_readv() {
use nix::sys::signal::*;
use nix::sys::wait::*;
- #[allow(unused_variables)]
- let m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
+ let _ = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
// Pre-allocate memory in the child, since allocation isn't safe
// post-fork (~= async-signal-safe)
diff --git a/test/sys/test_wait.rs b/test/sys/test_wait.rs
index 2f68e7c4..d07d82f0 100644
--- a/test/sys/test_wait.rs
+++ b/test/sys/test_wait.rs
@@ -7,8 +7,7 @@ use libc::_exit;
#[test]
fn test_wait_signal() {
- #[allow(unused_variables)]
- let m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
+ let _ = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
// Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe.
match fork().expect("Error: Fork Failed") {
@@ -25,8 +24,7 @@ fn test_wait_signal() {
#[test]
fn test_wait_exit() {
- #[allow(unused_variables)]
- let m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
// Safe: Child only calls `_exit`, which is async-signal-safe.
match fork().expect("Error: Fork Failed") {
@@ -96,8 +94,7 @@ mod ptrace {
#[test]
fn test_wait_ptrace() {
- #[allow(unused_variables)]
- let m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test");
match fork().expect("Error: Fork Failed") {
Child => ptrace_child(),