Change 24703 by [EMAIL PROTECTED] on 2005/06/04 07:16:11

        Simplify the getppid code, by Alexey Tourbin

Affected files ...

... //depot/perl/pp_sys.c#406 edit

Differences ...

==== //depot/perl/pp_sys.c#406 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#405~24689~    Fri Jun  3 01:31:26 2005
+++ perl/pp_sys.c       Sat Jun  4 00:16:11 2005
@@ -4372,12 +4372,9 @@
 #ifdef HAS_GETPPID
     dSP; dTARGET;
 #   ifdef THREADS_HAVE_PIDS
-    {
-       IV cur_ppid = getppid();
-       if (cur_ppid == 1)
-           /* maybe the parent process has died. Refresh ppid cache */
-           PL_ppid = cur_ppid;
-    }
+    if (PL_ppid != 1 && getppid() == 1)
+       /* maybe the parent process has died. Refresh ppid cache */
+       PL_ppid = 1;
     XPUSHi( PL_ppid );
 #   else
     XPUSHi( getppid() );
End of Patch.

Reply via email to