mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-01 07:13:24 +03:00
Replace sa_sigaction with sa_union.__su_sigaction for AIX.
This commit is contained in:
@@ -25,7 +25,14 @@ fn start(argc: isize, argv: *const *const u8) -> isize {
|
||||
let actual = unsafe {
|
||||
let mut actual: libc::sigaction = std::mem::zeroed();
|
||||
libc::sigaction(libc::SIGPIPE, std::ptr::null(), &mut actual);
|
||||
actual.sa_sigaction
|
||||
#[cfg(not(target_os = "aix"))]
|
||||
{
|
||||
actual.sa_sigaction
|
||||
}
|
||||
#[cfg(target_os = "aix")]
|
||||
{
|
||||
actual.sa_union.__su_sigaction as libc::sighandler_t
|
||||
}
|
||||
};
|
||||
|
||||
assert_eq!(actual, expected, "actual and expected SIGPIPE disposition in child differs");
|
||||
|
||||
@@ -20,7 +20,14 @@ 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);
|
||||
actual.sa_sigaction
|
||||
#[cfg(not(target_os = "aix"))]
|
||||
{
|
||||
actual.sa_sigaction
|
||||
}
|
||||
#[cfg(target_os = "aix")]
|
||||
{
|
||||
actual.sa_union.__su_sigaction as libc::sighandler_t
|
||||
}
|
||||
};
|
||||
|
||||
let expected = match expected_handler {
|
||||
|
||||
@@ -29,7 +29,14 @@ 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 _;
|
||||
action.sa_sigaction = signal_handler as sighandler_t;
|
||||
#[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;
|
||||
}
|
||||
sigaction(SIGWINCH, &action, std::ptr::null_mut());
|
||||
|
||||
// Send SIGWINCH on exit.
|
||||
|
||||
Reference in New Issue
Block a user