mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
agent: Remove unnecessary underscore(_) variables
We should remove underscore(_) prefixed variables when ? operator is used. Fixes: #1903 Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
This commit is contained in:
parent
0c463babf3
commit
20a382c158
@ -545,7 +545,7 @@ fn do_init_child(cwfd: RawFd) -> Result<()> {
|
|||||||
// notify parent to run prestart hooks
|
// notify parent to run prestart hooks
|
||||||
write_sync(cwfd, SYNC_SUCCESS, "")?;
|
write_sync(cwfd, SYNC_SUCCESS, "")?;
|
||||||
// wait parent run prestart hooks
|
// wait parent run prestart hooks
|
||||||
let _ = read_sync(crfd)?;
|
read_sync(crfd)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if mount_fd != -1 {
|
if mount_fd != -1 {
|
||||||
@ -1254,7 +1254,7 @@ async fn join_namespaces(
|
|||||||
|
|
||||||
if p.init {
|
if p.init {
|
||||||
info!(logger, "notify child parent ready to run prestart hook!");
|
info!(logger, "notify child parent ready to run prestart hook!");
|
||||||
let _ = read_async(pipe_r).await?;
|
read_async(pipe_r).await?;
|
||||||
|
|
||||||
info!(logger, "get ready to run prestart hook!");
|
info!(logger, "get ready to run prestart hook!");
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ async fn start_sandbox(
|
|||||||
let mut server = rpc::start(sandbox.clone(), config.server_addr.as_str());
|
let mut server = rpc::start(sandbox.clone(), config.server_addr.as_str());
|
||||||
server.start().await?;
|
server.start().await?;
|
||||||
|
|
||||||
let _ = rx.await?;
|
rx.await?;
|
||||||
server.shutdown().await?;
|
server.shutdown().await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -37,10 +37,10 @@ pub fn reseed_rng(data: &[u8]) -> Result<()> {
|
|||||||
&len as *const libc::c_long,
|
&len as *const libc::c_long,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
let _ = Errno::result(ret).map(drop)?;
|
Errno::result(ret).map(drop)?;
|
||||||
|
|
||||||
let ret = unsafe { libc::ioctl(f.as_raw_fd(), RNDRESEEDRNG as IoctlRequestType, 0) };
|
let ret = unsafe { libc::ioctl(f.as_raw_fd(), RNDRESEEDRNG as IoctlRequestType, 0) };
|
||||||
let _ = Errno::result(ret).map(drop)?;
|
Errno::result(ret).map(drop)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ impl AgentService {
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let cid = req.container_id.clone();
|
let cid = req.container_id.clone();
|
||||||
|
|
||||||
let _ = verify_cid(&cid)?;
|
verify_cid(&cid)?;
|
||||||
|
|
||||||
let mut oci_spec = req.OCI.clone();
|
let mut oci_spec = req.OCI.clone();
|
||||||
let use_sandbox_pidns = req.get_sandbox_pidns();
|
let use_sandbox_pidns = req.get_sandbox_pidns();
|
||||||
@ -926,7 +926,7 @@ impl protocols::agent_ttrpc::AgentService for AgentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for m in req.kernel_modules.iter() {
|
for m in req.kernel_modules.iter() {
|
||||||
let _ = load_kernel_module(m)
|
load_kernel_module(m)
|
||||||
.map_err(|e| ttrpc_error(ttrpc::Code::INTERNAL, e.to_string()))?;
|
.map_err(|e| ttrpc_error(ttrpc::Code::INTERNAL, e.to_string()))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1529,22 +1529,22 @@ fn setup_bundle(cid: &str, spec: &mut Spec) -> Result<PathBuf> {
|
|||||||
fn cleanup_process(p: &mut Process) -> Result<()> {
|
fn cleanup_process(p: &mut Process) -> Result<()> {
|
||||||
if p.parent_stdin.is_some() {
|
if p.parent_stdin.is_some() {
|
||||||
p.close_stream(StreamType::ParentStdin);
|
p.close_stream(StreamType::ParentStdin);
|
||||||
let _ = unistd::close(p.parent_stdin.unwrap())?;
|
unistd::close(p.parent_stdin.unwrap())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.parent_stdout.is_some() {
|
if p.parent_stdout.is_some() {
|
||||||
p.close_stream(StreamType::ParentStdout);
|
p.close_stream(StreamType::ParentStdout);
|
||||||
let _ = unistd::close(p.parent_stdout.unwrap())?;
|
unistd::close(p.parent_stdout.unwrap())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.parent_stderr.is_some() {
|
if p.parent_stderr.is_some() {
|
||||||
p.close_stream(StreamType::ParentStderr);
|
p.close_stream(StreamType::ParentStderr);
|
||||||
let _ = unistd::close(p.parent_stderr.unwrap())?;
|
unistd::close(p.parent_stderr.unwrap())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.term_master.is_some() {
|
if p.term_master.is_some() {
|
||||||
p.close_stream(StreamType::TermMaster);
|
p.close_stream(StreamType::TermMaster);
|
||||||
let _ = unistd::close(p.term_master.unwrap())?;
|
unistd::close(p.term_master.unwrap())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.notify_term_close();
|
p.notify_term_close();
|
||||||
|
Loading…
Reference in New Issue
Block a user