summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-04 15:49:15 +0000
committerGitHub <noreply@github.com>2019-09-04 15:49:15 +0000
commit01f4d57eede3ed2f1051778113b1d6a7dff8e9d6 (patch)
tree785be7555521b922ebea9b46c740197d255157ce /test
parent54cd6fe77977652256d695d565e1b1a5fe4d5613 (diff)
parent6a1c217b22017a7f37f3426259c394b1f305ff4a (diff)
downloadnix-01f4d57eede3ed2f1051778113b1d6a7dff8e9d6.zip
Merge #1113
1113: Libc enum tryfrom r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/sys/test_signal.rs3
-rw-r--r--test/sys/test_signalfd.rs4
2 files changed, 5 insertions, 2 deletions
diff --git a/test/sys/test_signal.rs b/test/sys/test_signal.rs
index 8780763f..11875750 100644
--- a/test/sys/test_signal.rs
+++ b/test/sys/test_signal.rs
@@ -2,6 +2,7 @@ use libc;
use nix::Error;
use nix::sys::signal::*;
use nix::unistd::*;
+use std::convert::TryFrom;
use std::sync::atomic::{AtomicBool, Ordering};
#[test]
@@ -75,7 +76,7 @@ lazy_static! {
}
extern fn test_sigaction_handler(signal: libc::c_int) {
- let signal = Signal::from_c_int(signal).unwrap();
+ let signal = Signal::try_from(signal).unwrap();
SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed);
}
diff --git a/test/sys/test_signalfd.rs b/test/sys/test_signalfd.rs
index a3b60988..92759a48 100644
--- a/test/sys/test_signalfd.rs
+++ b/test/sys/test_signalfd.rs
@@ -1,3 +1,5 @@
+use std::convert::TryFrom;
+
#[test]
fn test_signalfd() {
use nix::sys::signalfd::SignalFd;
@@ -20,6 +22,6 @@ fn test_signalfd() {
// And now catch that same signal.
let res = fd.read_signal().unwrap().unwrap();
- let signo = Signal::from_c_int(res.ssi_signo as i32).unwrap();
+ let signo = Signal::try_from(res.ssi_signo as i32).unwrap();
assert_eq!(signo, signal::SIGUSR1);
}