Skip to content

Commit

Permalink
fix(init): spawn child instead of becoming one
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Dec 11, 2024
1 parent 0971c36 commit af88ff8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn init_stage_parent(args: SetupArgs) -> isize {
0 // Exit child process
}

fn init_stage_child(args: SetupArgs) -> ! {
fn init_stage_child(args: SetupArgs) -> isize {
let linux_spec = args.config.spec.linux().as_ref().unwrap();
debug!("Enter init_stage child");
let _ = prctl::set_name("runh:INIT");
Expand Down Expand Up @@ -664,8 +664,8 @@ fn init_stage_child(args: SetupArgs) -> ! {
if let Some(tap_fd) = tap_fd {
cmd.preserved_fds(vec![tap_fd]);
}
let error = cmd.exec();
let status = cmd.status().unwrap();
assert!(status.success());

//This point should not be reached on successful exec
panic!("exec failed with error {}", error)
0
}

0 comments on commit af88ff8

Please sign in to comment.