From: Ximin Luo Date: Mon, 27 Jul 2020 01:42:02 +0000 (+0100) Subject: [PATCH] rustbuild: fix bad usage of UNIX exec() in rustc wrapper X-Git-Tag: archive/raspbian/1.46.0+dfsg1-1+rpi1^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0b74de825dcce9935cf71b4f39f02ccfd60ac274;p=rustc.git [PATCH] rustbuild: fix bad usage of UNIX exec() in rustc wrapper exec never returns, it replaces the current process. so anything after it is unreachable. that's not how exec_cmd() is used in the surrounding code Gbp-Pq: Name u-fix-exec.patch --- diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index fd36cd9bd8..c8ee4cb0cd 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -186,13 +186,6 @@ fn main() { std::process::exit(code); } -#[cfg(unix)] -fn exec_cmd(cmd: &mut Command) -> io::Result { - use std::os::unix::process::CommandExt; - Err(cmd.exec()) -} - -#[cfg(not(unix))] fn exec_cmd(cmd: &mut Command) -> io::Result { cmd.status().map(|status| status.code().unwrap()) }