diff options
Diffstat (limited to 'pod/perlipc.pod')
-rw-r--r-- | pod/perlipc.pod | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pod/perlipc.pod b/pod/perlipc.pod index c75fa958d0..02f2687419 100644 --- a/pod/perlipc.pod +++ b/pod/perlipc.pod @@ -191,33 +191,33 @@ located in the subroutine C<code()>, which simply prints some debug info to show that it works and should be replaced with the real code. #!/usr/bin/perl -w - + use POSIX (); use FindBin (); use File::Basename (); use File::Spec::Functions; - + $|=1; - + # make the daemon cross-platform, so exec always calls the script # itself with the right path, no matter how the script was invoked. my $script = File::Basename::basename($0); my $SELF = catfile $FindBin::Bin, $script; - + # POSIX unmasks the sigprocmask properly 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) or die "Couldn't restart: $!\n"; } - + code(); - + sub code { print "PID: $$\n"; print "ARGV: @ARGV\n"; |