mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
Port debug_thread_error() to Rust
This commit is contained in:
committed by
Peter Ammon
parent
38ac21ba5e
commit
76205e5b55
@@ -947,6 +947,17 @@ pub const fn char_offset(base: char, offset: u32) -> char {
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[inline(never)]
|
||||
fn debug_thread_error() {
|
||||
// Wait for a SIGINT. We can't use sigsuspend() because the signal may be delivered on another
|
||||
// thread.
|
||||
use crate::signal::SigChecker;
|
||||
use crate::topic_monitor::topic_t;
|
||||
let sigint = SigChecker::new(topic_t::sighupint);
|
||||
sigint.wait();
|
||||
}
|
||||
|
||||
/// Exits without invoking destructors (via _exit), useful for code after fork.
|
||||
pub fn exit_without_destructors(code: i32) -> ! {
|
||||
unsafe { libc::_exit(code) };
|
||||
|
||||
Reference in New Issue
Block a user