diff options
author | Jason King <jason.brian.king@gmail.com> | 2020-06-17 01:11:05 +0000 |
---|---|---|
committer | Jason King <jason.brian.king@gmail.com> | 2021-03-21 23:04:03 +0000 |
commit | d444f1bcf20b29d0ec69e30046c71d005a2b9d72 (patch) | |
tree | 09c410385c727ac6f9e9bfae71077901f5edfb6d /test/sys | |
parent | 7b3129a194ecbf3e5f99f30ff26ab0e6fa7f183d (diff) | |
download | nix-d444f1bcf20b29d0ec69e30046c71d005a2b9d72.zip |
illumos and Solaris support
Co-authored-by: Dominik Hassler <hadfl@omnios.org>
Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
Diffstat (limited to 'test/sys')
-rw-r--r-- | test/sys/test_signal.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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(); } |