diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-02 17:10:19 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-02 17:10:19 +0000 |
commit | 0e0556fc348ff5f8beae704376481cf3219b0abd (patch) | |
tree | 3bbd76297d7dd9c75eb32166b89500a63a79d37d /pp_sys.c | |
parent | 4edc9001f2ec62106f8580f228ec1bc0aadfc27b (diff) | |
download | perl-0e0556fc348ff5f8beae704376481cf3219b0abd.tar.gz |
For perls where pids and ppids are cached, when the ppid of
the perl process becomes 1, refresh the ppid cache (this may
indicate that the parent process has died.)
p4raw-id: //depot/perl@24367
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -4377,6 +4377,12 @@ 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; + } XPUSHi( PL_ppid ); # else XPUSHi( getppid() ); |