diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-05-09 11:59:50 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-05-09 11:59:50 +0000 |
commit | 0a0ada86d5873275d2ecec5cb3ffc5cb284ca30d (patch) | |
tree | 69b246a03def1a5e58e4d6f3f8e6957d26e3567f /pp_sys.c | |
parent | 7e78a3dd0a001bb9e811c17c95314cd5b6e3113a (diff) | |
download | perl-0a0ada86d5873275d2ecec5cb3ffc5cb284ca30d.tar.gz |
If wait() or waitpid() ends due to EINTR despatch perl interrupt handler
and re-try. Fixes "perl 5.7.x prefers suicide over killing more than one child."
p4raw-id: //depot/perlio@10048
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -3902,7 +3902,13 @@ PP(pp_wait) Pid_t childpid; int argflags; +#ifdef PERL_OLD_SIGNALS childpid = wait4pid(-1, &argflags, 0); +#else + while ((childpid = wait4pid(-1, &argflags, 0)) == -1 && errno == EINTR) { + PERL_ASYNC_CHECK(); + } +#endif # if defined(USE_ITHREADS) && defined(PERL_IMPLICIT_SYS) /* 0 and -1 are both error returns (the former applies to WNOHANG case) */ STATUS_NATIVE_SET((childpid && childpid != -1) ? argflags : -1); @@ -3926,7 +3932,13 @@ PP(pp_waitpid) optype = POPi; childpid = TOPi; +#ifdef PERL_OLD_SIGNALS childpid = wait4pid(childpid, &argflags, optype); +#else + while ((childpid = wait4pid(childpid, &argflags, optype)) == -1 && errno == EINTR) { + PERL_ASYNC_CHECK(); + } +#endif # if defined(USE_ITHREADS) && defined(PERL_IMPLICIT_SYS) /* 0 and -1 are both error returns (the former applies to WNOHANG case) */ STATUS_NATIVE_SET((childpid && childpid != -1) ? argflags : -1); |