@@ -670,21 +670,12 @@ impl SigAction {
670670 /// is the `SigAction` variant). `mask` specifies other signals to block during execution of
671671 /// the signal-catching function.
672672 pub fn new( handler: SigHandler , flags: SaFlags , mask: SigSet ) -> SigAction {
673- #[ cfg( target_os = "redox" ) ]
674- unsafe fn install_sig( p: * mut libc:: sigaction, handler: SigHandler ) {
675- ( * p) . sa_handler = match handler {
676- SigHandler :: SigDfl => libc:: SIG_DFL ,
677- SigHandler :: SigIgn => libc:: SIG_IGN ,
678- SigHandler :: Handler ( f) => f as * const extern fn ( libc:: c_int) as usize ,
679- } ;
680- }
681-
682- #[ cfg( not( target_os = "redox" ) ) ]
683673 unsafe fn install_sig( p: * mut libc:: sigaction, handler: SigHandler ) {
684674 ( * p) . sa_sigaction = match handler {
685675 SigHandler :: SigDfl => libc:: SIG_DFL ,
686676 SigHandler :: SigIgn => libc:: SIG_IGN ,
687677 SigHandler :: Handler ( f) => f as * const extern fn ( libc:: c_int) as usize ,
678+ #[ cfg( not( target_os = "redox" ) ) ]
688679 SigHandler :: SigAction ( f) => f as * const extern fn ( libc:: c_int, * mut libc:: siginfo_t, * mut libc:: c_void) as usize ,
689680 } ;
690681 }
@@ -716,12 +707,11 @@ impl SigAction {
716707 }
717708
718709 /// Returns the action's handler.
719- #[ cfg( not( target_os = "redox" ) ) ]
720- #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
721710 pub fn handler( & self ) -> SigHandler {
722711 match self . sigaction. sa_sigaction {
723712 libc:: SIG_DFL => SigHandler :: SigDfl ,
724713 libc:: SIG_IGN => SigHandler :: SigIgn ,
714+ #[ cfg( not( target_os = "redox" ) ) ]
725715 p if self . flags( ) . contains( SaFlags :: SA_SIGINFO ) =>
726716 SigHandler :: SigAction (
727717 // Safe for one of two reasons:
@@ -749,28 +739,6 @@ impl SigAction {
749739 as extern fn ( libc:: c_int) ) ,
750740 }
751741 }
752-
753- /// Returns the action's handler.
754- #[ cfg( target_os = "redox" ) ]
755- #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
756- pub fn handler( & self ) -> SigHandler {
757- match self . sigaction. sa_handler {
758- libc:: SIG_DFL => SigHandler :: SigDfl ,
759- libc:: SIG_IGN => SigHandler :: SigIgn ,
760- p => SigHandler :: Handler (
761- // Safe for one of two reasons:
762- // * The SigHandler was created by SigHandler::new, in which
763- // case the pointer is correct, or
764- // * The SigHandler was created by signal or sigaction, which
765- // are unsafe functions, so the caller should've somehow
766- // ensured that it is correctly initialized.
767- unsafe {
768- * ( & p as * const usize
769- as * const extern fn ( libc:: c_int) )
770- }
771- as extern fn ( libc:: c_int) ) ,
772- }
773- }
774742}
775743
776744/// Changes the action taken by a process on receipt of a specific signal.
0 commit comments