diff options
| author | Xing Xue <xingxue@outlook.com> | 2025-03-12 10:39:09 -0400 |
|---|---|---|
| committer | Xing Xue <xingxue@outlook.com> | 2025-03-12 10:39:09 -0400 |
| commit | 17d1e050e6fd0ad6bf9f85d3f81da5a39d09d03c (patch) | |
| tree | 2fa50ff5bc028447d1da3f9a78419067b9c1692b | |
| parent | 0998d4095b0f11061f78a3f9c77a87838a4c1cb7 (diff) | |
| download | rust-17d1e050e6fd0ad6bf9f85d3f81da5a39d09d03c.tar.gz rust-17d1e050e6fd0ad6bf9f85d3f81da5a39d09d03c.zip | |
Use sa_sigaction instead of sa_union.__su_sigaction for AIX.
3 files changed, 3 insertions, 24 deletions
diff --git a/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs b/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs index f3f9ce0bd87..3a574af9bba 100644 --- a/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs +++ b/tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs @@ -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"); diff --git a/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs b/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs index d16a2b4d8c8..3d93d50ca3f 100644 --- a/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs +++ b/tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs @@ -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 { diff --git a/tests/ui/runtime/signal-alternate-stack-cleanup.rs b/tests/ui/runtime/signal-alternate-stack-cleanup.rs index 8fce0928273..f2af86be0a5 100644 --- a/tests/ui/runtime/signal-alternate-stack-cleanup.rs +++ b/tests/ui/runtime/signal-alternate-stack-cleanup.rs @@ -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. |
