fix perlipc example regarding process group
authorZefram <zefram@fysh.org>
Thu, 18 Jan 2018 03:05:10 +0000 (03:05 +0000)
committerZefram <zefram@fysh.org>
Thu, 18 Jan 2018 03:08:58 +0000 (03:08 +0000)
Fixes [perl #54412].

pod/perlipc.pod

index e3b74a5..902655d 100644 (file)
@@ -67,8 +67,8 @@ so it doesn't kill itself:
     # block scope for local
     {
         local $SIG{HUP} = "IGNORE";
-        kill HUP => -$$;
-        # snazzy writing of: kill("HUP", -$$)
+        kill HUP => -getpgrp();
+        # snazzy writing of: kill("HUP", -getpgrp())
     }
 
 Another interesting signal to send is signal number zero.  This doesn't