Skip to content

Commit c756251

Browse files
authored
Rollup merge of rust-lang#138409 - xingxue-ibm:use-sigaction, r=compiler-errors
Use sa_sigaction instead of sa_union.__su_sigaction for AIX Revert test cases to use `sa_sigaction` instead of `sa_union.__su_sigaction`, now that the `libc` crate implementation for AIX defines `sa_sigaction` as a direct member of `struct sigaction`, aligning it with implementations on other similar platforms. ([[AIX] Use sa_sigaction instead of the union](rust-lang/libc#4250)).
2 parents 9d1b62c + 17d1e05 commit c756251

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

tests/ui/runtime/on-broken-pipe/auxiliary/assert-sigpipe-disposition.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,7 @@ extern "C" fn main(argc: core::ffi::c_int, argv: *const *const u8) -> core::ffi:
2626
let actual = unsafe {
2727
let mut actual: libc::sigaction = core::mem::zeroed();
2828
libc::sigaction(libc::SIGPIPE, core::ptr::null(), &mut actual);
29-
#[cfg(not(target_os = "aix"))]
30-
{
31-
actual.sa_sigaction
32-
}
33-
#[cfg(target_os = "aix")]
34-
{
35-
actual.sa_union.__su_sigaction as libc::sighandler_t
36-
}
29+
actual.sa_sigaction
3730
};
3831

3932
assert_eq!(actual, expected, "actual and expected SIGPIPE disposition in child differs");

tests/ui/runtime/on-broken-pipe/auxiliary/sigpipe-utils.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ pub fn assert_sigpipe_handler(expected_handler: SignalHandler) {
2020
let actual = unsafe {
2121
let mut actual: libc::sigaction = std::mem::zeroed();
2222
libc::sigaction(libc::SIGPIPE, std::ptr::null(), &mut actual);
23-
#[cfg(not(target_os = "aix"))]
24-
{
25-
actual.sa_sigaction
26-
}
27-
#[cfg(target_os = "aix")]
28-
{
29-
actual.sa_union.__su_sigaction as libc::sighandler_t
30-
}
23+
actual.sa_sigaction
3124
};
3225

3326
let expected = match expected_handler {

tests/ui/runtime/signal-alternate-stack-cleanup.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ fn main() {
2929
// Install signal handler that runs on alternate signal stack.
3030
let mut action: sigaction = std::mem::zeroed();
3131
action.sa_flags = (SA_ONSTACK | SA_SIGINFO) as _;
32-
#[cfg(not(target_os = "aix"))]
33-
{
34-
action.sa_sigaction = signal_handler as sighandler_t;
35-
}
36-
#[cfg(target_os = "aix")]
37-
{
38-
action.sa_union.__su_sigaction = signal_handler as sighandler_t;
39-
}
32+
action.sa_sigaction = signal_handler as sighandler_t;
4033
sigaction(SIGWINCH, &action, std::ptr::null_mut());
4134

4235
// Send SIGWINCH on exit.

0 commit comments

Comments
 (0)