From d444f1bcf20b29d0ec69e30046c71d005a2b9d72 Mon Sep 17 00:00:00 2001 From: Jason King Date: Wed, 17 Jun 2020 01:11:05 +0000 Subject: illumos and Solaris support Co-authored-by: Dominik Hassler Co-authored-by: Joshua M. Clulow --- test/sys/test_signal.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/sys') diff --git a/test/sys/test_signal.rs b/test/sys/test_signal.rs index ae22527f..fdb7f36d 100644 --- a/test/sys/test_signal.rs +++ b/test/sys/test_signal.rs @@ -108,8 +108,15 @@ fn test_signal() { assert_eq!(unsafe { signal(Signal::SIGINT, handler) }.unwrap(), SigHandler::SigDfl); raise(Signal::SIGINT).unwrap(); assert!(SIGNALED.load(Ordering::Relaxed)); + + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), handler); + // System V based OSes (e.g. illumos and Solaris) always resets the + // disposition to SIG_DFL prior to calling the signal handler + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigDfl); + // Restore default signal handler unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(); } -- cgit v1.2.3