abort: fix unsafe-op-in-unsafe-fn, signal path, unused imports

- abort() body: use signal::sys::SIGABRT (the platform-independent name
  the signal module uses for both linux and redox submodules)
- call sites: wrap abort() in unsafe { } blocks (Rust 2024 edition's
  unsafe_op_in_unsafe_fn lint makes this mandatory inside unsafe fns)
- stdlib/mod.rs, start.rs: drop now-unused 'intrinsics' import
This commit is contained in:
Red Bear OS
2026-06-28 04:17:35 +03:00
parent 4e40dc538c
commit c1b8c3b4cf
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -20,5 +20,5 @@ pub unsafe extern "C" fn __assert_fail(
eprintln!("{}: {}:{}: Assertion `{}` failed.", func, file, line, cond);
crate::header::stdlib::abort();
unsafe { crate::header::stdlib::abort() };
}
+3 -3
View File
@@ -2,7 +2,7 @@
//!
//! See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/stdlib.h.html>.
use core::{convert::TryFrom, intrinsics, iter, mem, ptr, slice};
use core::{convert::TryFrom, iter, mem, ptr, slice};
use rand::{
RngExt, SeedableRng,
distr::{Alphanumeric, Distribution, Uniform},
@@ -117,8 +117,8 @@ pub unsafe extern "C" fn a64l(s: *const c_char) -> c_long {
#[unsafe(no_mangle)]
pub unsafe extern "C" fn abort() -> ! {
log::error!("Abort");
crate::header::signal::raise(crate::header::signal::redox::SIGABRT as c_int);
_Exit(128 + crate::header::signal::redox::SIGABRT as c_int);
crate::header::signal::raise(crate::header::signal::sys::SIGABRT as c_int);
_Exit(128 + crate::header::signal::sys::SIGABRT as c_int);
}
#[cfg(not(target_pointer_width = "64"))]