diff --git a/pod/perlipc.pod b/pod/perlipc.pod index db1fe3df723c1..30f08dd60c53d 100644 --- a/pod/perlipc.pod +++ b/pod/perlipc.pod @@ -205,10 +205,16 @@ info to show that it works; it should be replaced with the real code. my $SELF = catfile($FindBin::Bin, $script); # POSIX unmasks the sigprocmask properly - $SIG{HUP} = sub { + my $sigset = POSIX::SigSet->new(); + my $action = POSIX::SigAction->new("sigHUP_handler", + $sigset, + &POSIX::SA_NODEFER); + POSIX::sigaction(&POSIX::SIGHUP, $action); + + sub sigHUP_handler { print "got SIGHUP\n"; exec($SELF, @ARGV) || die "$0: couldn't restart: $!"; - }; + } code();