File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments