diff --git a/libafl_bolts/src/core_affinity.rs b/libafl_bolts/src/core_affinity.rs index dfd734d80f..336e5d140e 100644 --- a/libafl_bolts/src/core_affinity.rs +++ b/libafl_bolts/src/core_affinity.rs @@ -350,12 +350,14 @@ mod linux { // FIXME: no sense of cpu granularity (yet ?) #[cfg(target_os = "haiku")] +#[allow(clippy::unnecessary_wraps)] #[inline] fn get_core_ids_helper() -> Result, Error> { Ok(Vec::new()) } #[cfg(target_os = "haiku")] +#[allow(clippy::unnecessary_wraps)] #[inline] fn set_for_current_helper(_core_id: CoreId) -> Result<(), Error> { Ok(()) diff --git a/libafl_bolts/src/minibsod.rs b/libafl_bolts/src/minibsod.rs index 15f9f34172..1341305687 100644 --- a/libafl_bolts/src/minibsod.rs +++ b/libafl_bolts/src/minibsod.rs @@ -653,7 +653,7 @@ fn write_crash( _ucontext: &ucontext_t, ) -> Result<(), std::io::Error> { // TODO add fault addr for other platforms. - writeln!(writer, "Received signal {}", signal,)?; + writeln!(writer, "Received signal {signal}")?; Ok(()) } @@ -848,15 +848,16 @@ fn write_minibsod(writer: &mut BufWriter) -> Result<(), std::io::Er #[cfg(target_os = "haiku")] fn write_minibsod(writer: &mut BufWriter) -> Result<(), std::io::Error> { - let mut info: libc::image_info = unsafe { std::mem::zeroed() }; + let p = std::mem::MaybeUninit::::uninit(); + let mut info = unsafe { p.assume_init() }; let mut c: i32 = 0; loop { if unsafe { libc::get_next_image_info(0, &mut c, &mut info) } == libc::B_OK { let i = format!( "{}-{} {:?}\n", - info.text as u64, - info.text as u64 + info.text_size as u64, + info.text as i64, + info.text as i64 + i64::from(info.text_size), info.name ); writer.write_all(&i.into_bytes())?; diff --git a/libafl_bolts/src/shmem.rs b/libafl_bolts/src/shmem.rs index 96f1c789ea..a519e0fbb6 100644 --- a/libafl_bolts/src/shmem.rs +++ b/libafl_bolts/src/shmem.rs @@ -10,9 +10,9 @@ use core::fmt::Display; use core::{cell::RefCell, fmt, mem::ManuallyDrop}; #[cfg(feature = "std")] use std::env; -#[cfg(all(unix, feature = "std"))] +#[cfg(all(unix, feature = "std", not(target_os = "haiku")))] use std::io::Read; -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(target_os = "haiku")))] use std::io::Write; use serde::{Deserialize, Serialize}; @@ -27,7 +27,7 @@ pub use unix_shmem::{UnixShMem, UnixShMemProvider}; #[cfg(all(windows, feature = "std"))] pub use win32_shmem::{Win32ShMem, Win32ShMemProvider}; -#[cfg(all(unix, feature = "std"))] +#[cfg(all(unix, feature = "std", not(target_os = "haiku")))] use crate::os::pipes::Pipe; #[cfg(all(feature = "std", unix, not(target_os = "haiku")))] pub use crate::os::unix_shmem_server::{ServedShMemProvider, ShMemService}; @@ -411,7 +411,7 @@ impl Drop for RcShMem { /// that can use internal mutability. /// Useful if the `ShMemProvider` needs to keep local state. #[derive(Debug, Clone)] -#[cfg(all(unix, feature = "std"))] +#[cfg(all(unix, feature = "std", not(target_os = "haiku")))] pub struct RcShMemProvider where SP: ShMemProvider, @@ -505,7 +505,7 @@ where } } -#[cfg(all(unix, feature = "std"))] +#[cfg(all(unix, feature = "std", not(target_os = "haiku")))] impl RcShMemProvider where SP: ShMemProvider, @@ -1457,7 +1457,7 @@ pub struct ShMemCursor { pos: usize, } -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(target_os = "haiku")))] impl ShMemCursor { /// Create a new [`ShMemCursor`] around [`ShMem`] pub fn new(shmem: T) -> Self { @@ -1473,7 +1473,7 @@ impl ShMemCursor { } } -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(target_os = "haiku")))] impl Write for ShMemCursor { fn write(&mut self, buf: &[u8]) -> std::io::Result { match self.empty_slice_mut().write(buf) {