Skip to content

Commit c326e78

Browse files
committed
wasm target included + update to error convention
Signed-off-by: Aminu 'Seun Joshua <[email protected]>
1 parent bad15ec commit c326e78

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/subprocess.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl ExitStatusError {
2424
}
2525
}
2626

27-
#[cfg(windows)]
27+
#[cfg(not(unix))]
2828
pub(crate) fn new(status: std::process::ExitStatus) -> Self {
2929
if let Some(code) = status.code() {
3030
Self::ExitCode(code)
@@ -36,9 +36,10 @@ impl ExitStatusError {
3636
pub fn code(&self) -> i32 {
3737
match self {
3838
Self::ExitCode(code) => *code,
39-
Self::Signal(signal) => *signal,
39+
Self::Signal(signal) => 128 + *signal,
4040
Self::Unknown => 1,
4141
}
42+
.min(255)
4243
}
4344
}
4445

@@ -50,7 +51,7 @@ impl std::fmt::Display for ExitStatusError {
5051

5152
match self {
5253
Self::ExitCode(code) => writeln!(f, "{code}"),
53-
Self::Signal(signal) => writeln!(f, "{signal}"),
54+
Self::Signal(signal) => writeln!(f, "signal {signal}"),
5455
Self::Unknown => writeln!(f, "unknown"),
5556
}
5657
}

0 commit comments

Comments
 (0)