aboutsummaryrefslogtreecommitdiffstats
path: root/src/run
diff options
context:
space:
mode:
Diffstat (limited to 'src/run')
-rw-r--r--src/run/mod.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/run/mod.rs b/src/run/mod.rs
index 3803936..2d137c6 100644
--- a/src/run/mod.rs
+++ b/src/run/mod.rs
@@ -166,8 +166,16 @@ impl Executor {
} else {
let mut code = 0;
for jh in threads {
- // TODO do not ignore panics
- let _ = jh.join();
+ match jh.join() {
+ Ok(Ok(())) => (),
+ Ok(Err(e)) => {
+ match e {
+ BuiltinError::IO(_) => code = -1,
+ BuiltinError::Exit(c) => code = c,
+ }
+ }
+ Err(_) => code = 127,
+ }
}
for child in children.iter_mut() {
match child.wait() {
@@ -258,7 +266,7 @@ pub fn run(se: Arc<Mutex<Session>>, cmd: Vec<u8>) {
}
#[derive(Debug)]
-enum BuiltinError {
+pub enum BuiltinError {
IO(std::io::Error),
Exit(i32),
}