diff options
Diffstat (limited to 'test/sys')
-rw-r--r-- | test/sys/test_aio.rs | 9 | ||||
-rw-r--r-- | test/sys/test_wait.rs | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/test/sys/test_aio.rs b/test/sys/test_aio.rs index 7945aaf8..7e2bef63 100644 --- a/test/sys/test_aio.rs +++ b/test/sys/test_aio.rs @@ -8,7 +8,6 @@ use std::io::{Write, Read, Seek, SeekFrom}; use std::ops::Deref; use std::os::unix::io::AsRawFd; use std::rc::Rc; -use std::sync::Mutex; use std::sync::atomic::{AtomicBool, Ordering}; use std::{thread, time}; use tempfile::tempfile; @@ -233,8 +232,6 @@ fn test_write() { lazy_static! { pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); - // protects access to SIGUSR2 handlers, not just SIGNALED - pub static ref SIGUSR2_MTX: Mutex<()> = Mutex::new(()); } extern fn sigfunc(_: c_int) { @@ -246,7 +243,8 @@ extern fn sigfunc(_: c_int) { #[test] #[cfg_attr(any(all(target_env = "musl", target_arch = "x86_64"), target_arch = "mips"), ignore)] fn test_write_sigev_signal() { - let _ = SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test"); + #[allow(unused_variables)] + let m = ::SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test"); let sa = SigAction::new(SigHandler::Handler(sigfunc), SA_RESETHAND, SigSet::empty()); @@ -376,7 +374,8 @@ fn test_lio_listio_nowait() { #[cfg(not(any(target_os = "ios", target_os = "macos")))] #[cfg_attr(any(target_arch = "mips", target_env = "musl"), ignore)] fn test_lio_listio_signal() { - let _ = SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test"); + #[allow(unused_variables)] + let m = ::SIGUSR2_MTX.lock().expect("Mutex got poisoned by another test"); const INITIAL: &'static [u8] = b"abcdef123456"; const WBUF: &'static [u8] = b"CDEF"; let rbuf = Rc::new(vec![0; 4].into_boxed_slice()); diff --git a/test/sys/test_wait.rs b/test/sys/test_wait.rs index d8ac94e4..2e28d9e7 100644 --- a/test/sys/test_wait.rs +++ b/test/sys/test_wait.rs @@ -6,6 +6,9 @@ use libc::exit; #[test] fn test_wait_signal() { + #[allow(unused_variables)] + let m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test"); + match fork() { Ok(Child) => pause().unwrap_or(()), Ok(Parent { child }) => { @@ -19,6 +22,9 @@ fn test_wait_signal() { #[test] fn test_wait_exit() { + #[allow(unused_variables)] + let m = ::FORK_MTX.lock().expect("Mutex got poisoned by another test"); + match fork() { Ok(Child) => unsafe { exit(12); }, Ok(Parent { child }) => { |