1
0
Fork 0
forked from wry/wry

reaper: setup deathsig in compositor

This commit is contained in:
Julian Orth 2025-05-10 20:03:34 +02:00
parent f97cb46315
commit b3334449a6

View file

@ -135,6 +135,7 @@ pub fn ensure_reaper() -> c::pid_t {
if let Ok(id) = env::var(REAPER_VAR) {
if let Ok(id) = c::pid_t::from_str(&id) {
if uapi::getppid() == id {
set_deathsig();
return id;
}
}
@ -157,6 +158,7 @@ pub fn ensure_reaper() -> c::pid_t {
unsafe {
env::set_var(REAPER_VAR, reaper_pid.to_string());
}
set_deathsig();
return reaper_pid;
};
set_process_name("jay reaper");
@ -167,3 +169,9 @@ pub fn ensure_reaper() -> c::pid_t {
}
process::exit(1);
}
fn set_deathsig() {
unsafe {
c::prctl(c::PR_SET_PDEATHSIG, c::SIGKILL as c::c_ulong);
}
}