pub fn install() {
#[cfg(all(coverage, target_os = "linux"))]
{
use std::sync::Once;
static ONCE: Once = Once::new();
ONCE.call_once(|| unsafe {
libc::signal(
libc::SIGABRT,
flush_then_reraise as extern "C" fn(libc::c_int) as libc::sighandler_t,
);
});
}
}
#[cfg(all(coverage, target_os = "linux"))]
extern "C" fn flush_then_reraise(_sig: libc::c_int) {
extern "C" {
fn __llvm_profile_write_file() -> libc::c_int;
}
unsafe {
__llvm_profile_write_file();
libc::signal(libc::SIGABRT, libc::SIG_DFL);
libc::raise(libc::SIGABRT);
}
}