diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-06-04 07:16:11 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-06-04 07:16:11 +0000 |
commit | e39f92a70db67080a9f47f8040bee423d1d1928f (patch) | |
tree | a605f4f37d5f63b1d6ad4d51c4845bd242d5bcd9 /pp_sys.c | |
parent | 7698c435fea241ff5aec7932afdb5f821dde55f3 (diff) | |
download | perl-e39f92a70db67080a9f47f8040bee423d1d1928f.tar.gz |
Simplify the getppid code, by Alexey Tourbin
p4raw-id: //depot/perl@24703
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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() ); |