Skip to content

Commit cc7c9f6

Browse files
committed
Fix bazelbuild#1209 and get debug information.
1 parent 628e85e commit cc7c9f6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

util/process_wrapper/main.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,19 @@ fn main() {
7575
}
7676
}
7777

78-
exit(status.code().unwrap())
78+
#[cfg(target_family = "unix")]
79+
let exit_code = if cfg!(unix) {
80+
use std::os::unix::process::ExitStatusExt;
81+
let exit_code = match status.code() {
82+
Some(c) => c,
83+
None => {
84+
eprintln!("process wrapper error: subprocess does not have an exit code. core_dumped: {}, signal: {:?}, stopped_signal: {:?}", status.core_dumped(), status.signal(), status.stopped_signal());
85+
1
86+
}
87+
};
88+
exit(exit_code)
89+
} else {
90+
status.code().unwrap_or(1)
91+
};
92+
exit(exit_code)
7993
}

0 commit comments

Comments
 (0)