This commit is contained in:
Andrea Fioraldi 2022-06-08 17:33:34 +02:00 committed by GitHub
parent 323b8e23ee
commit 395b616718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1474,6 +1474,14 @@ where
match res { match res {
WaitStatus::Signaled(_, _, _) => Ok(ExitKind::Crash), WaitStatus::Signaled(_, _, _) => Ok(ExitKind::Crash),
WaitStatus::Exited(_, code) => {
if code > 128 && code < 160 {
// Signal exit codes
Ok(ExitKind::Crash)
} else {
Ok(ExitKind::Ok)
}
}
_ => Ok(ExitKind::Ok), _ => Ok(ExitKind::Ok),
} }
} }
@ -1586,7 +1594,8 @@ pub mod child_signal_handlers {
.post_exec_child_all(state, input, &ExitKind::Crash) .post_exec_child_all(state, input, &ExitKind::Crash)
.expect("Failed to run post_exec on observers"); .expect("Failed to run post_exec on observers");
std::process::abort(); // std::process::abort();
unsafe { libc::_exit(128 + 6) }; // ABORT exit code
} }
})); }));
} }
@ -1617,7 +1626,7 @@ pub mod child_signal_handlers {
.expect("Failed to run post_exec on observers"); .expect("Failed to run post_exec on observers");
} }
//libc::_exit(128 + (_signal as i32)); libc::_exit(128 + (_signal as i32));
} }
} }