Skip to content
Myr

Avoid confusion between exit code and signal values

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordi Chauzi · committed by David Peter · parent 5564407 · Browse files · 1 file+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:src/hyperfine/benchmark.rs+6 added-1 removed
207 unmodified lines
208 /* From the ExitStatus::code documentation:209 "On Unix, this will return None if the process was terminated by a signal."210 In that case, ExitStatusExt::signal should never return None.211 */212 status.code().or_else(|| status.signal())212 status.code().or_else(||213 /* To differentiate between "normal" exit codes and signals, we are using214 something similar to bash exit codes (https://tldp.org/LDP/abs/html/exitcodes.html)215 by adding 128 to a signal integer value.216 */217 status.signal().map(|s| 128 + s))218}219220#[cfg(not(unix))]221fn extract_exit_code(status: ExitStatus) -> Option<i32> {
252 unmodified lines