Skip to content

Commit

Permalink
Merge pull request #896 from utam0k/fix/notify-close
Browse files Browse the repository at this point in the history
How many times in my life do I have to repeat forgetting close?
  • Loading branch information
Furisto authored May 6, 2022
2 parents f2e5b93 + c81a8dc commit 1591680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions crates/libcontainer/src/notify_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl NotifyListener {
Ok(())
}

pub fn close(&mut self) -> Result<()> {
pub fn close(&self) -> Result<()> {
close(self.socket.as_raw_fd())?;
Ok(())
}
Expand All @@ -75,9 +75,4 @@ impl NotifySocket {
unistd::chdir(&cwd)?;
Ok(())
}

pub fn notify_container_finish(&mut self) -> Result<()> {
// self.socket.write_all(b"finish container")?;
Ok(())
}
}
1 change: 1 addition & 0 deletions crates/libcontainer/src/process/container_init_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ pub fn container_init_process(

// listing on the notify socket for container start command
args.notify_socket.wait_for_container_start()?;
args.notify_socket.close()?;

// create_container hook needs to be called after the namespace setup, but
// before pivot_root is called. This runs in the container namespaces.
Expand Down

0 comments on commit 1591680

Please sign in to comment.