Skip to content

Commit

Permalink
Fix compilation: StderrForwarder::set_non_blocking should always be…
Browse files Browse the repository at this point in the history
… called

Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu committed Feb 14, 2024
1 parent 3d56928 commit 8e5d0bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/command_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl CargoOutput {

pub(crate) struct StderrForwarder {
inner: Option<(ChildStderr, Vec<u8>)>,
#[cfg(all(feature = "parallel", unix))]
#[cfg(feature = "parallel")]
is_non_blocking: bool,
#[cfg(feature = "parallel")]
bytes_available_failed: bool,
Expand Down Expand Up @@ -163,10 +163,11 @@ impl StderrForwarder {
}
}

#[cfg(all(feature = "parallel", unix))]
#[cfg(feature = "parallel")]
pub(crate) fn set_non_blocking(&mut self) -> Result<(), Error> {
assert!(!self.is_non_blocking);

#[cfg(unix)]
if let Some((stderr, _)) = self.inner.as_ref() {
crate::parallel::stderr::set_non_blocking(stderr)?;
}
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,6 @@ impl Build {
};
let mut child = spawn(&mut cmd, &program, &self.cargo_output)?;
let mut stderr_forwarder = StderrForwarder::new(&mut child);
#[cfg(unix)]
stderr_forwarder.set_non_blocking()?;

cell_update(&pendings, |mut pendings| {
Expand Down

0 comments on commit 8e5d0bb

Please sign in to comment.