From 387f1c332681a3cabe04294bce801e9c8c433df5 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Thu, 4 Jul 2024 15:10:15 +0200 Subject: [PATCH] Check SA_NOCLDSTOP in sig_will_ign. --- src/sigabi.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sigabi.rs b/src/sigabi.rs index cedc0ed14f..fe0917d7b8 100644 --- a/src/sigabi.rs +++ b/src/sigabi.rs @@ -96,8 +96,12 @@ pub fn sig_bit(sig: usize) -> u64 { 1 << (sig - 1) } impl SigProcControl { - pub fn signal_will_ign(&self, sig: usize) -> bool { - self.actions[sig - 1].first.load(Ordering::Relaxed) & (1 << 63) != 0 + pub fn signal_will_ign(&self, sig: usize, is_parent_sigchld: bool) -> bool { + let flags = self.actions[sig - 1].first.load(Ordering::Relaxed); + let will_ign = flags & (1 << 63) != 0; + let sig_specific = flags & (1 << 62) != 0; // SA_NOCLDSTOP if sig == SIGCHLD + + will_ign || (sig == SIGCHLD && is_parent_sigchld && sig_specific) } pub fn signal_will_stop(&self, sig: usize) -> bool { use crate::flag::*; @@ -108,6 +112,8 @@ impl SigProcControl { #[cfg(not(target_arch = "x86"))] pub use core::sync::atomic::AtomicU64; +use crate::SIGCHLD; + #[cfg(target_arch = "x86")] pub use self::atomic::AtomicU64;