summaryrefslogtreecommitdiffstats
path: root/src/state/history/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-03 11:37:11 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-03 11:37:24 -0500
commit10717b2b1f29a1b35742ae0cb98e775ac55e248c (patch)
treeceebb71087ce0c9ca3c1b23f55b94917bfccbed9 /src/state/history/mod.rs
parentd152b349df84fbe1d37029315dfae04888495346 (diff)
downloadnbsh-10717b2b1f29a1b35742ae0cb98e775ac55e248c.tar.gz
nbsh-10717b2b1f29a1b35742ae0cb98e775ac55e248c.zip
fix up a few bugs with child event handling
Diffstat (limited to 'src/state/history/mod.rs')
-rw-r--r--src/state/history/mod.rs9
1 files changed, 7 insertions, 2 deletions
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);
}