mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:32:13 +08:00
Remove unsafe from exit_without_destructors()
std::process::exit() already does what we need and and it is safe to call (since it is not unsafe for destructors not to be called).
This commit is contained in:
parent
20b500dce8
commit
f9c92753c4
|
@ -965,11 +965,11 @@ pub const fn char_offset(base: char, offset: u32) -> char {
|
|||
}
|
||||
}
|
||||
|
||||
/// Exits without invoking destructors (via _exit), useful for code after fork.
|
||||
/// Exits without invoking destructors; useful for forked processes.
|
||||
///
|
||||
/// [`std::process::exit()`] is used; it exits immediately without running any destructors.
|
||||
fn exit_without_destructors(code: i32) -> ! {
|
||||
unsafe {
|
||||
libc::_exit(code);
|
||||
}
|
||||
std::process::exit(code)
|
||||
}
|
||||
|
||||
/// Save the shell mode on startup so we can restore them on exit.
|
||||
|
|
Loading…
Reference in New Issue
Block a user