Skip to content

Commit

Permalink
fix(init): clippy::zombie_processes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Dec 11, 2024
1 parent af88ff8 commit efabe9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ fn init_stage_child(args: SetupArgs) -> isize {
nix::unistd::close(fifo_fd).expect("Could not close exec fifo O_PATH fd!");
nix::unistd::close(init_pipe.into_raw_fd()).expect("Could not close init pipe fd!");

let mut child = None;
if args.config.is_hermit_container {
let micro_vm: u32 = env::var("RUNH_MICRO_VM")
.unwrap_or_else(|_| "0".to_string())
Expand Down Expand Up @@ -650,7 +651,7 @@ fn init_stage_child(args: SetupArgs) -> isize {
}
cmd.envs(std::env::vars());

let _child = cmd.spawn().expect("Unable to virtiofsd");
child = Some(cmd.spawn().expect("Unable to virtiofsd"));
}
}

Expand All @@ -667,5 +668,9 @@ fn init_stage_child(args: SetupArgs) -> isize {
let status = cmd.status().unwrap();
assert!(status.success());

if let Some(mut child) = child {
child.wait().unwrap();
}

0
}

0 comments on commit efabe9b

Please sign in to comment.