projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7698c43
)
Simplify the getppid code, by Alexey Tourbin
author
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Sat, 4 Jun 2005 07:16:11 +0000
(07:16 +0000)
committer
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Sat, 4 Jun 2005 07:16:11 +0000
(07:16 +0000)
p4raw-id: //depot/perl@24703
pp_sys.c
patch
|
blob
|
history
diff --git
a/pp_sys.c
b/pp_sys.c
index
1171ec8
..
89bb05d
100644
(file)
--- a/
pp_sys.c
+++ b/
pp_sys.c
@@
-4372,12
+4372,9
@@
PP(pp_getppid)
#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() );