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(new_state)
.spawn()
.expect("Swaymsg rotate command failed to start");
.expect("Swaymsg rotate command failed to start")
.wait()
.expect("Swaymsg rotate command wait failed");
}
Backend::Xorg => {
Command::new("xrandr")
.arg("-o")
.arg(x_state)
.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")
.arg("set-prop")
@ -220,7 +224,9 @@ fn main() -> Result<(), String> {
.arg("Matrix")
.args(&matrix)
.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;