Skip to content

Commit a94df52

Browse files
committed
Bump libc to v0.2.171 and use sa_action instead of sa_union.__su_sigaction.
1 parent 61e2cf6 commit a94df52

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

signal-hook-registry/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,7 @@ impl Slot {
158158
fn new(signal: libc::c_int) -> Result<Self, Error> {
159159
// C data structure, expected to be zeroed out.
160160
let mut new: libc::sigaction = unsafe { mem::zeroed() };
161-
#[cfg(not(target_os = "aix"))]
162-
{ new.sa_sigaction = handler as usize; }
163-
#[cfg(target_os = "aix")]
164-
{ new.sa_union.__su_sigaction = handler; }
161+
new.sa_sigaction = handler as usize;
165162
// Android is broken and uses different int types than the rest (and different depending on
166163
// the pointer width). This converts the flags to the proper type no matter what it is on
167164
// the given platform.
@@ -239,10 +236,7 @@ impl Prev {
239236

240237
#[cfg(not(windows))]
241238
unsafe fn execute(&self, sig: c_int, info: *mut siginfo_t, data: *mut c_void) {
242-
#[cfg(not(target_os = "aix"))]
243239
let fptr = self.info.sa_sigaction;
244-
#[cfg(target_os = "aix")]
245-
let fptr = self.info.sa_union.__su_sigaction as usize;
246240
if fptr != 0 && fptr != libc::SIG_DFL && fptr != libc::SIG_IGN {
247241
// Android is broken and uses different int types than the rest (and different
248242
// depending on the pointer width). This converts the flags to the proper type no

src/low_level/signal_details.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,7 @@ fn restore_default(signal: c_int) -> Result<(), Error> {
111111
unsafe {
112112
// A C structure, supposed to be memset to 0 before use.
113113
let mut action: libc::sigaction = mem::zeroed();
114-
#[cfg(target_os = "aix")]
115-
{
116-
action.sa_union.__su_sigaction = mem::transmute::<
117-
usize,
118-
extern "C" fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void),
119-
>(libc::SIG_DFL);
120-
}
121-
#[cfg(not(target_os = "aix"))]
122-
{ action.sa_sigaction = libc::SIG_DFL as _; }
114+
action.sa_sigaction = libc::SIG_DFL as _;
123115
if libc::sigaction(signal, &action, ptr::null_mut()) == 0 {
124116
Ok(())
125117
} else {

0 commit comments

Comments
 (0)