Use sa_sigaction instead of sa_union.__su_sigaction for AIX.
This commit is contained in:
parent
0998d4095b
commit
17d1e050e6
3 changed files with 3 additions and 24 deletions
|
@ -26,14 +26,7 @@ extern "C" fn main(argc: core::ffi::c_int, argv: *const *const u8) -> core::ffi:
|
|||
let actual = unsafe {
|
||||
let mut actual: libc::sigaction = core::mem::zeroed();
|
||||
libc::sigaction(libc::SIGPIPE, core::ptr::null(), &mut actual);
|
||||
#[cfg(not(target_os = "aix"))]
|
||||
{
|
||||
actual.sa_sigaction
|
||||
}
|
||||
#[cfg(target_os = "aix")]
|
||||
{
|
||||
actual.sa_union.__su_sigaction as libc::sighandler_t
|
||||
}
|
||||
actual.sa_sigaction
|
||||
};
|
||||
|
||||
assert_eq!(actual, expected, "actual and expected SIGPIPE disposition in child differs");
|
||||
|
|
|
@ -20,14 +20,7 @@ pub fn assert_sigpipe_handler(expected_handler: SignalHandler) {
|
|||
let actual = unsafe {
|
||||
let mut actual: libc::sigaction = std::mem::zeroed();
|
||||
libc::sigaction(libc::SIGPIPE, std::ptr::null(), &mut actual);
|
||||
#[cfg(not(target_os = "aix"))]
|
||||
{
|
||||
actual.sa_sigaction
|
||||
}
|
||||
#[cfg(target_os = "aix")]
|
||||
{
|
||||
actual.sa_union.__su_sigaction as libc::sighandler_t
|
||||
}
|
||||
actual.sa_sigaction
|
||||
};
|
||||
|
||||
let expected = match expected_handler {
|
||||
|
|
|
@ -29,14 +29,7 @@ fn main() {
|
|||
// Install signal handler that runs on alternate signal stack.
|
||||
let mut action: sigaction = std::mem::zeroed();
|
||||
action.sa_flags = (SA_ONSTACK | SA_SIGINFO) as _;
|
||||
#[cfg(not(target_os = "aix"))]
|
||||
{
|
||||
action.sa_sigaction = signal_handler as sighandler_t;
|
||||
}
|
||||
#[cfg(target_os = "aix")]
|
||||
{
|
||||
action.sa_union.__su_sigaction = signal_handler as sighandler_t;
|
||||
}
|
||||
action.sa_sigaction = signal_handler as sighandler_t;
|
||||
sigaction(SIGWINCH, &action, std::ptr::null_mut());
|
||||
|
||||
// Send SIGWINCH on exit.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue