Skip to content

Commit

Permalink
cleanup pipe_in left overs from debugging session
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Feb 4, 2024
1 parent 6c9bb24 commit 1b5e265
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/common/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2366,20 +2366,15 @@ impl UChild {

let join_handle = std::thread::Builder::new()
.name("pipe_in".to_string())
.spawn(move || {
let result = writer.write_all(&content);
let result2 = result.and_then(|()| writer.flush());
std::mem::drop(writer);

let result = match result2 {
.spawn(
move || match writer.write_all(&content).and_then(|()| writer.flush()) {
Err(error) if !ignore_stdin_write_error => Err(io::Error::new(
io::ErrorKind::Other,
format!("failed to write to stdin of child: {error}"),
)),
Ok(()) | Err(_) => Ok(()),
};
result
})
},
)
.unwrap();

self.join_handle = Some(join_handle);
Expand Down

0 comments on commit 1b5e265

Please sign in to comment.