summaryrefslogtreecommitdiff
path: root/test/sys/test_signal.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-05-30 12:27:39 -0600
committerAlan Somers <asomers@gmail.com>2021-05-30 20:12:41 -0600
commit7b7d9540056f6378820caf955a0335268184d6b7 (patch)
treef27fa7b8dbb4d089c0f7bda9569bfab8ead1b4dc /test/sys/test_signal.rs
parenta55dd4537286c8fbd96e3e21e18c56a38f8124b9 (diff)
downloadnix-7b7d9540056f6378820caf955a0335268184d6b7.zip
misc Clippy cleanup
* Fix race conditions in the tests. Two tests were grabbing a mutex but immediately dropping it. Thank you, Clippy. * Remove vestigial Windows support. Remove some code added to support Windows in 2015. Nix is no longer intended to ever run on Windows. * Various other minor Clippy lints.
Diffstat (limited to 'test/sys/test_signal.rs')
-rw-r--r--test/sys/test_signal.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/sys/test_signal.rs b/test/sys/test_signal.rs
index fdb7f36d..c8c13e52 100644
--- a/test/sys/test_signal.rs
+++ b/test/sys/test_signal.rs
@@ -1,4 +1,3 @@
-use libc;
#[cfg(not(target_os = "redox"))]
use nix::Error;
use nix::sys::signal::*;
@@ -53,9 +52,9 @@ fn test_sigprocmask() {
// Make sure the old set doesn't contain the signal, otherwise the following
// test don't make sense.
- assert_eq!(old_signal_set.contains(SIGNAL), false,
- "the {:?} signal is already blocked, please change to a \
- different one", SIGNAL);
+ assert!(!old_signal_set.contains(SIGNAL),
+ "the {:?} signal is already blocked, please change to a \
+ different one", SIGNAL);
// Now block the signal.
let mut signal_set = SigSet::empty();
@@ -67,8 +66,8 @@ fn test_sigprocmask() {
old_signal_set.clear();
sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set))
.expect("expect to be able to retrieve old signals");
- assert_eq!(old_signal_set.contains(SIGNAL), true,
- "expected the {:?} to be blocked", SIGNAL);
+ assert!(old_signal_set.contains(SIGNAL),
+ "expected the {:?} to be blocked", SIGNAL);
// Reset the signal.
sigprocmask(SigmaskHow::SIG_UNBLOCK, Some(&signal_set), None)