diff --git a/src/builtins/mod.rs b/src/builtins/mod.rs index 7887fbf48d785374c987c615197bd218d5ff767e..b9b772ae9b7898c51184d3c935034d4d07c3cb9c 100644 --- a/src/builtins/mod.rs +++ b/src/builtins/mod.rs @@ -30,8 +30,9 @@ fn exit_builtin() -> Builtin { name: "exit", help: "To exit the curent session", main: Box::new(|args: &[&str], shell: &mut Shell| -> i32 { + let previous_status = shell.previous_status; shell.exit(args.get(1).and_then(|status| status.parse::<i32>().ok()) - .unwrap_or(shell.previous_status)) + .unwrap_or(previous_status)) }), } } diff --git a/src/shell/job_control.rs b/src/shell/job_control.rs index d8bac210c52f7ae85ddc9b2e6fe150439bcce034..b975b892e114aeb2a98860e65c059ac632059948 100644 --- a/src/shell/job_control.rs +++ b/src/shell/job_control.rs @@ -256,7 +256,11 @@ impl<'a> JobControl for Shell<'a> { } #[cfg(target_os = "redox")] - fn watch_foreground(&mut self, pid: u32) -> i32 { + fn watch_foreground <F: Fn() -> String> ( + &mut self, + pid: u32, + _get_command: F + ) -> i32 { use std::io::{self, Write}; use std::os::unix::process::ExitStatusExt; use std::process::ExitStatus; @@ -345,7 +349,8 @@ impl<'a> JobControl for Shell<'a> { } #[cfg(target_os = "redox")] - fn handle_signal(&self, _: i32) { + fn handle_signal(&self, _: i32) -> bool { // TODO: Redox doesn't support signals yet; + false } }