Skip to content

Commit df5cd47

Browse files
xingxue-ibmtgross35
authored andcommitted
Use sa_sigaction instead the union for AIX.
(backport <rust-lang#4250>) (cherry picked from commit fcb9df0)
1 parent 1d231c3 commit df5cd47

File tree

1 file changed

+3
-51
lines changed

1 file changed

+3
-51
lines changed

src/unix/aix/mod.rs

+3-51
Original file line numberDiff line numberDiff line change
@@ -533,20 +533,15 @@ s! {
533533
pub it_interval: crate::timespec,
534534
pub it_value: crate::timespec,
535535
}
536-
}
537-
538-
s_no_extra_traits! {
539-
pub union __sigaction_sa_union {
540-
pub __su_handler: extern "C" fn(c: c_int),
541-
pub __su_sigaction: extern "C" fn(c: c_int, info: *mut siginfo_t, ptr: *mut c_void),
542-
}
543536

544537
pub struct sigaction {
545-
pub sa_union: __sigaction_sa_union,
538+
pub sa_sigaction: crate::sighandler_t, // FIXME(union): this field is actually a union
546539
pub sa_mask: sigset_t,
547540
pub sa_flags: c_int,
548541
}
542+
}
549543

544+
s_no_extra_traits! {
550545
pub union __poll_ctl_ext_u {
551546
pub addr: *mut c_void,
552547
pub data32: u32,
@@ -565,49 +560,6 @@ s_no_extra_traits! {
565560

566561
cfg_if! {
567562
if #[cfg(feature = "extra_traits")] {
568-
impl PartialEq for __sigaction_sa_union {
569-
fn eq(&self, other: &__sigaction_sa_union) -> bool {
570-
unsafe {
571-
self.__su_handler == other.__su_handler
572-
&& self.__su_sigaction == other.__su_sigaction
573-
}
574-
}
575-
}
576-
impl Eq for __sigaction_sa_union {}
577-
impl hash::Hash for __sigaction_sa_union {
578-
fn hash<H: hash::Hasher>(&self, state: &mut H) {
579-
unsafe {
580-
self.__su_handler.hash(state);
581-
self.__su_sigaction.hash(state);
582-
}
583-
}
584-
}
585-
586-
impl PartialEq for sigaction {
587-
fn eq(&self, other: &sigaction) -> bool {
588-
self.sa_mask == other.sa_mask
589-
&& self.sa_flags == other.sa_flags
590-
&& self.sa_union == other.sa_union
591-
}
592-
}
593-
impl Eq for sigaction {}
594-
impl fmt::Debug for sigaction {
595-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
596-
f.debug_struct("sigaction")
597-
.field("sa_union", &self.sa_union)
598-
.field("sa_mask", &self.sa_mask)
599-
.field("sa_flags", &self.sa_flags)
600-
.finish()
601-
}
602-
}
603-
impl hash::Hash for sigaction {
604-
fn hash<H: hash::Hasher>(&self, state: &mut H) {
605-
self.sa_union.hash(state);
606-
self.sa_mask.hash(state);
607-
self.sa_flags.hash(state);
608-
}
609-
}
610-
611563
impl PartialEq for __poll_ctl_ext_u {
612564
fn eq(&self, other: &__poll_ctl_ext_u) -> bool {
613565
unsafe {

0 commit comments

Comments
 (0)