mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-30 14:25:43 +00:00
Merge pull request #820 from Tim-Zhang/mark-unreachable
Indicates never return function and remove unreachable code
This commit is contained in:
commit
ad7b1ff5ad
@ -340,8 +340,6 @@ pub fn init_child() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::process::exit(-1);
|
||||
}
|
||||
|
||||
fn do_init_child(cwfd: RawFd) -> Result<()> {
|
||||
@ -647,8 +645,6 @@ fn do_init_child(cwfd: RawFd) -> Result<()> {
|
||||
}
|
||||
|
||||
do_exec(&args);
|
||||
|
||||
Err(anyhow!("fail to create container"))
|
||||
}
|
||||
|
||||
impl BaseContainer for LinuxContainer {
|
||||
@ -1022,7 +1018,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 +1037,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