fix(process): wait on child to prevent zombie

This commit is contained in:
Ashley Wulber 2024-08-22 10:32:07 -04:00 committed by Michael Murphy
parent 1162011ff4
commit 57256e53e5

View file

@ -37,7 +37,10 @@ pub async fn spawn(mut command: Command) -> Option<u32> {
1.. => {
// Drop copy of write end, then read PID from pipe
drop(write);
read_from_pipe(read).await
let pid = read_from_pipe(read).await;
// wait to prevent zombie
_ = rustix::process::wait(rustix::process::WaitOptions::empty());
pid
}
// Child process