Skip to content

Commit

Permalink
Merge pull request #1836 from yihuaf/yihuaf/fix-1812
Browse files Browse the repository at this point in the history
Fix Errno as unresolved type.
  • Loading branch information
utam0k authored Apr 23, 2023
2 parents 554d43c + b293e8f commit 00b7bfd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration_tests_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
changes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
changes:
Expand Down
10 changes: 3 additions & 7 deletions crates/libcontainer/src/process/container_main_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use nix::unistd::Pid;
use crate::seccomp;
#[cfg(feature = "libseccomp")]
use nix::{
errno::Errno,
sys::socket::{self, UnixAddr},
unistd,
};
Expand Down Expand Up @@ -117,15 +116,12 @@ pub fn container_main_process(container_args: &ContainerArgs) -> Result<Pid> {
log::warn!("intermediate process killed with signal: {sig}")
}
Ok(_) => (),
Err(err) => {
Err(nix::errno::Errno::ECHILD) => {
// This is safe because intermediate_process and main_process check if the process is
// finished by piping instead of exit code.
if err == Errno::ECHILD {
log::warn!("intermediate process already reaped");
} else {
bail!("failed to wait for intermediate process: {err}");
}
log::warn!("intermediate process already reaped");
}
Err(err) => bail!("failed to wait for intermediate process: {err}"),
};

Ok(init_pid)
Expand Down

0 comments on commit 00b7bfd

Please sign in to comment.