Ensure no zombie processes are left behind

Dead subprocesses need an explicit wait before they're reaped
This commit is contained in:
mnussbaum 2019-09-06 00:22:08 -07:00
parent 2a548252d1
commit 7832d2be2c
1 changed files with 9 additions and 3 deletions

View File

@ -203,14 +203,18 @@ fn main() -> Result<(), String> {
.arg("transform") .arg("transform")
.arg(new_state) .arg(new_state)
.spawn() .spawn()
.expect("Swaymsg rotate command failed to start"); .expect("Swaymsg rotate command failed to start")
.wait()
.expect("Swaymsg rotate command wait failed");
} }
Backend::Xorg => { Backend::Xorg => {
Command::new("xrandr") Command::new("xrandr")
.arg("-o") .arg("-o")
.arg(x_state) .arg(x_state)
.spawn() .spawn()
.expect("Xrandr rotate command failed to start"); .expect("Xrandr rotate command failed to start")
.wait()
.expect("Xrandr rotate command wait failed");
Command::new("xinput") Command::new("xinput")
.arg("set-prop") .arg("set-prop")
@ -220,7 +224,9 @@ fn main() -> Result<(), String> {
.arg("Matrix") .arg("Matrix")
.args(&matrix) .args(&matrix)
.spawn() .spawn()
.expect("Xinput rotate command failed to start"); .expect("Xinput rotate command failed to start")
.wait()
.expect("Xinput rotate command wait failed");
} }
} }
old_state = new_state; old_state = new_state;