summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorSteve Grazzini <grazz@pobox.com>2003-10-04 14:15:23 -0400
committerAbhijit Menon-Sen <ams@wiw.org>2003-10-05 03:08:53 +0000
commit2ec0bfb3e2d19a14c6a2cf1939c9549394a191c1 (patch)
tree91f10384efdb093df3dab0d1bcc2ba0e6d139f1f /pp_sys.c
parenta0bd7037d700e5357a2ac886eb134d5822a9ece2 (diff)
downloadperl-2ec0bfb3e2d19a14c6a2cf1939c9549394a191c1.tar.gz
pp_sys.c: pp_waitpid and EINTR
Message-Id: <20031004221523.GA29324@grazzini.net> p4raw-id: //depot/perl@21402
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 8253df9e10..10d052943c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4037,27 +4037,28 @@ PP(pp_waitpid)
{
#if (!defined(DOSISH) || defined(OS2) || defined(WIN32)) && !defined(MACOS_TRADITIONAL)
dSP; dTARGET;
- Pid_t childpid;
+ Pid_t pid;
+ Pid_t result;
int optype;
int argflags;
optype = POPi;
- childpid = TOPi;
+ pid = TOPi;
if (PL_signals & PERL_SIGNALS_UNSAFE_FLAG)
- childpid = wait4pid(childpid, &argflags, optype);
+ result = wait4pid(pid, &argflags, optype);
else {
- while ((childpid = wait4pid(childpid, &argflags, optype)) == -1 &&
+ while ((result = wait4pid(pid, &argflags, optype)) == -1 &&
errno == EINTR) {
PERL_ASYNC_CHECK();
}
}
# 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);
+ STATUS_NATIVE_SET((result && result != -1) ? argflags : -1);
# else
- STATUS_NATIVE_SET((childpid > 0) ? argflags : -1);
+ STATUS_NATIVE_SET((result > 0) ? argflags : -1);
# endif
- SETi(childpid);
+ SETi(result);
RETURN;
#else
DIE(aTHX_ PL_no_func, "waitpid");