From 10717b2b1f29a1b35742ae0cb98e775ac55e248c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 3 Jan 2022 11:37:11 -0500 Subject: fix up a few bugs with child event handling --- src/state/history/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/state/history/mod.rs') diff --git a/src/state/history/mod.rs b/src/state/history/mod.rs index fa02b98..5ed86b3 100644 --- a/src/state/history/mod.rs +++ b/src/state/history/mod.rs @@ -593,9 +593,9 @@ async fn run_pipeline( Res::Read( blocking::unblock(move || { let fh = unsafe { std::fs::File::from_raw_fd(from_r) }; - let env = bincode::deserialize_from(&fh); + let event = bincode::deserialize_from(&fh); let _ = fh.into_raw_fd(); - env + event }) .await, ) @@ -604,6 +604,11 @@ async fn run_pipeline( match read.or(exit).await { Res::Read(Ok(event)) => event_w.send(event).await.unwrap(), Res::Read(Err(e)) => { + if let bincode::ErrorKind::Io(e) = &*e { + if e.kind() == std::io::ErrorKind::UnexpectedEof { + continue; + } + } eprintln!("nbsh: {}", e); return (std::process::ExitStatus::from_raw(1 << 8), false); } -- cgit v1.2.3-54-g00ecf