reaper: setup deathsig in compositor
This commit is contained in:
parent
f97cb46315
commit
b3334449a6
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue