Set initial sigactions to SIG_DFL and correct bits.

This commit is contained in:
4lDO2
2024-07-01 17:35:19 +02:00
parent 6a3d247a90
commit 6d5d0eb61e
+11
View File
@@ -389,6 +389,17 @@ const fn sig_bit(sig: usize) -> u64 {
pub fn setup_sighandler(area: &RtSigarea) {
{
let mut sigactions = SIGACTIONS_LOCK.lock();
for (sig_idx, action) in PROC_CONTROL_STRUCT.actions.iter().enumerate() {
let sig = sig_idx + 1;
let bits = if matches!(sig, SIGTSTP | SIGTTIN | SIGTTOU) {
SigactionFlags::SIG_SPECIFIC
} else if matches!(sig, SIGCHLD | SIGURG | SIGWINCH) {
SigactionFlags::IGNORED
} else {
SigactionFlags::empty()
};
action.first.store((u64::from(bits.bits()) << 32) | default_handler as u64, Ordering::Relaxed);
}
}
let arch = unsafe { &mut *area.arch.get() };
{