Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
tar/write: Ensure repofd outlives child spawn
Browse files Browse the repository at this point in the history
Might help with #664
But I didn't manage to reliably reproduce this.
  • Loading branch information
cgwalters committed Oct 31, 2024
1 parent 0c118cb commit 71b59d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/tar/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ pub async fn write_tar(
let mut c = tokio::process::Command::from(c);
c.kill_on_drop(true);
let mut r = c.spawn()?;
// Ensure the fd is open until the process is spawned
drop(repofd);
tracing::trace!("Spawned ostree child process");
// Safety: We passed piped() for all of these
let child_stdin = r.stdin.take().unwrap();
Expand Down

0 comments on commit 71b59d0

Please sign in to comment.