wait for all child
This commit is contained in:
parent
e1ba2f7141
commit
d422f30774
@ -1,7 +1,7 @@
|
||||
use nix::{
|
||||
libc::{c_long, EPERM, ORIG_RAX},
|
||||
sys::stat::Mode,
|
||||
unistd::{getpid, getppid},
|
||||
unistd::{getpid, getppid, Pid},
|
||||
};
|
||||
use std::io::Write;
|
||||
use std::{
|
||||
@ -74,7 +74,7 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
loop {
|
||||
log::debug!("parent: waitpid...");
|
||||
let waitstatus = waitpid(child, None)?;
|
||||
let waitstatus = waitpid(Pid::from_raw(-1), None)?;
|
||||
|
||||
match waitstatus {
|
||||
WaitStatus::Exited(pid, ret) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user