aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index e7f4fe5..7074d38 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -424,8 +424,10 @@ fn shepard(mut state: EinState, signal_rx: Receiver<Signal>) {
}
println!("Reaping children... (count={})", brood.len());
- for (_, o) in brood.iter_mut() {
- o.process.wait().ok();
+ for (pid, o) in brood.iter() {
+ if o.is_active() {
+ nix::sys::wait::waitpid(*pid as i32, Some(nix::sys::wait::WNOHANG)).ok();
+ }
}
println!("Done.");
}