diff --git a/iceoryx2-bb/posix/src/signal.rs b/iceoryx2-bb/posix/src/signal.rs index c5116f819..8fdf7f5fb 100644 --- a/iceoryx2-bb/posix/src/signal.rs +++ b/iceoryx2-bb/posix/src/signal.rs @@ -66,7 +66,7 @@ use crate::{ use enum_iterator::{all, Sequence}; use iceoryx2_bb_elementary::enum_gen; use iceoryx2_bb_log::{fail, fatal_panic}; -use iceoryx2_pal_posix::posix::Struct; +use iceoryx2_pal_posix::posix::{Errno, Struct}; use iceoryx2_pal_posix::*; use lazy_static::lazy_static; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -184,6 +184,7 @@ tiny_fn! { pub struct SignalCallback = Fn(signal: FetchableSignal); } +#[derive(Debug)] struct SignalDetail { signal: FetchableSignal, state: posix::sigaction_t, @@ -509,10 +510,13 @@ impl SignalHandler { }; let mut previous_action = posix::sigaction_t::new(); - if unsafe { posix::sigaction(details.signal as i32, &adjusted_state, &mut previous_action) } - != 0 - { - fatal_panic!(from self, "This should never happen! Unable to register raw signal since sigaction was called with invalid parameters."); + let sigaction_return = unsafe { + posix::sigaction(details.signal as i32, &adjusted_state, &mut previous_action) + }; + + if sigaction_return != 0 { + fatal_panic!(from self, "This should never happen! posix::sigaction returned {}. Unable to register raw signal since sigaction was called with invalid parameters: {:?} which lead to error: {:?}.", + sigaction_return, details, Errno::get()); } previous_action diff --git a/iceoryx2-pal/posix/src/windows/types.rs b/iceoryx2-pal/posix/src/windows/types.rs index 8bf3c67d1..16db3f09c 100644 --- a/iceoryx2-pal/posix/src/windows/types.rs +++ b/iceoryx2-pal/posix/src/windows/types.rs @@ -63,7 +63,7 @@ pub type ushort = u16; pub type ulong = u64; pub type void = core::ffi::c_void; -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct sigset_t {} impl Struct for sigset_t {} @@ -221,7 +221,7 @@ pub struct sched_param { } impl Struct for sched_param {} -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] #[repr(C)] pub struct sigaction_t { pub iox2_sa_handler: sighandler_t,