Skip to content
Snippets Groups Projects
Verified Commit 6d5d0eb6 authored by Jacob Lorentzon's avatar Jacob Lorentzon
Browse files

Set initial sigactions to SIG_DFL and correct bits.

parent 6a3d247a
No related branches found
No related tags found
No related merge requests found
...@@ -389,6 +389,17 @@ const fn sig_bit(sig: usize) -> u64 { ...@@ -389,6 +389,17 @@ const fn sig_bit(sig: usize) -> u64 {
pub fn setup_sighandler(area: &RtSigarea) { pub fn setup_sighandler(area: &RtSigarea) {
{ {
let mut sigactions = SIGACTIONS_LOCK.lock(); 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() }; let arch = unsafe { &mut *area.arch.get() };
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment