1
0
Fork 0
forked from wry/wry

compositor: reset all signals during startup

This commit is contained in:
Julian Orth 2025-04-26 19:52:05 +02:00
parent 456457eade
commit fdfc20452f
3 changed files with 16 additions and 11 deletions

View file

@ -50,3 +50,15 @@ async fn handle_signals(fd: Rc<OwnedFd>, ring: Rc<IoUring>) {
}
}
}
pub fn reset_all() {
const NSIG: c::c_int = 64;
unsafe {
for sig in 1..=NSIG {
c::signal(sig, c::SIG_DFL);
}
}
let mut set: c::sigset_t = uapi::pod_zeroed();
uapi::sigfillset(&mut set).unwrap();
let _ = uapi::pthread_sigmask(c::SIG_UNBLOCK, Some(&set), None);
}