about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-12-19 12:17:24 +0000
committerbors <bors@rust-lang.org>2016-12-19 12:17:24 +0000
commit10271ea24fbd7b28a42df8eb02a8dcf6d6132d71 (patch)
tree4e6317a08c4c8cf2b0cbef21dd235222ccce77c1 /src/bootstrap
parente70415bd716cdbfaa7d7e849cb1d3b09254a7dcb (diff)
parent05be48b18b896c16b36cf3f68c14c87b79081f94 (diff)
downloadrust-10271ea24fbd7b28a42df8eb02a8dcf6d6132d71.tar.gz
rust-10271ea24fbd7b28a42df8eb02a8dcf6d6132d71.zip
Auto merge of #38466 - sanxiyn:rollup, r=sanxiyn
Rollup of 9 pull requests

- Successful merges: #38334, #38397, #38413, #38421, #38422, #38433, #38438, #38445, #38459
- Failed merges:
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 20ff9d9af3c..c5684e69994 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -30,7 +30,7 @@ extern crate bootstrap;
 use std::env;
 use std::ffi::OsString;
 use std::path::PathBuf;
-use std::process::Command;
+use std::process::{Command, ExitStatus};
 
 fn main() {
     let args = env::args_os().skip(1).collect::<Vec<_>>();
@@ -180,8 +180,19 @@ fn main() {
     }
 
     // Actually run the compiler!
-    std::process::exit(match cmd.status() {
-        Ok(s) => s.code().unwrap_or(1),
+    std::process::exit(match exec_cmd(&mut cmd) {
+        Ok(s) => s.code().unwrap_or(0xfe),
         Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
     })
 }
+
+#[cfg(unix)]
+fn exec_cmd(cmd: &mut Command) -> ::std::io::Result<ExitStatus> {
+    use std::os::unix::process::CommandExt;
+    Err(cmd.exec())
+}
+
+#[cfg(not(unix))]
+fn exec_cmd(cmd: &mut Command) -> ::std::io::Result<ExitStatus> {
+    cmd.status()
+}