mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
agent: Change do_exec return type to ! because it will never return
Indicates unreachable code. Fixes #819 Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
parent
9b2eaeeff0
commit
942999edb9
@ -1022,7 +1022,7 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
fn do_exec(args: &[String]) -> Result<()> {
|
||||
fn do_exec(args: &[String]) -> ! {
|
||||
let path = &args[0];
|
||||
let p = CString::new(path.to_string()).unwrap();
|
||||
let sa: Vec<CString> = args
|
||||
@ -1041,8 +1041,8 @@ fn do_exec(args: &[String]) -> Result<()> {
|
||||
_ => std::process::exit(-2),
|
||||
}
|
||||
}
|
||||
// should never reach here
|
||||
Ok(())
|
||||
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
fn update_namespaces(logger: &Logger, spec: &mut Spec, init_pid: RawFd) -> Result<()> {
|
||||
|
Loading…
Reference in New Issue
Block a user