summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-08-16 23:59:28 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-08-16 23:59:28 +0000
commit68a29c53b68ed5d3196e36d984ad46cc171fe95a (patch)
tree626bb44c8720286d96a37992437c5ffc0e6f5fbd /pp_sys.c
parentd6217f1e0304b5fb226ba520442a930ddceeea43 (diff)
downloadperl-68a29c53b68ed5d3196e36d984ad46cc171fe95a.tar.gz
on windows, the return values from wait() and waitpid() don't
match those of pseudo-pids p4raw-id: //depot/perl@6659
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 4f3abe5cc1..ba9e3bf5d7 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3738,7 +3738,12 @@ PP(pp_wait)
int argflags;
childpid = wait4pid(-1, &argflags, 0);
+# 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);
+# else
STATUS_NATIVE_SET((childpid > 0) ? argflags : -1);
+# endif
XPUSHi(childpid);
RETURN;
#else
@@ -3757,7 +3762,12 @@ PP(pp_waitpid)
optype = POPi;
childpid = TOPi;
childpid = wait4pid(childpid, &argflags, optype);
+# 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);
+# else
STATUS_NATIVE_SET((childpid > 0) ? argflags : -1);
+# endif
SETi(childpid);
RETURN;
#else