summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.ohio-state.edu>1996-10-09 22:32:22 -0400
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-10-09 22:32:22 -0400
commitddcf38b7f9d5581245fd5ce960320c0768ea6d39 (patch)
tree3686285b9b7a47ad6df9901094ec458ea9f99cf9
parentcd5de442d8c5b88479b970b44ba1acb12d72e0b5 (diff)
downloadperl-ddcf38b7f9d5581245fd5ce960320c0768ea6d39.tar.gz
perl 5.003_07: util.c
Date: Wed, 9 Oct 1996 22:32:22 -0400 (EDT) From: Ilya Zakharevich <ilya@math.ohio-state.edu> uses my_syspopen, my_syspclose ifdef OS2. my_pclose is defined as my_syspclose ifdef OS2 and can FORK (as OS2 does).
-rw-r--r--util.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/util.c b/util.c
index ea6641ad56..1c9369135b 100644
--- a/util.c
+++ b/util.c
@@ -1589,6 +1589,11 @@ char *mode;
SV *sv;
I32 doexec = strNE(cmd,"-");
+#ifdef OS2
+ if (doexec) {
+ return my_syspopen(cmd,mode);
+ }
+#endif
if (pipe(p) < 0)
return Nullfp;
this = (*mode == 'w');
@@ -1726,6 +1731,11 @@ PerlIO *ptr;
pid = (int)SvIVX(*svp);
SvREFCNT_dec(*svp);
*svp = &sv_undef;
+#ifdef OS2
+ if (pid == -1) { /* Opened by popen. */
+ return my_syspclose(ptr);
+ }
+#endif
PerlIO_close(ptr);
#ifdef UTS
if(kill(pid, 0) < 0) { return(pid); } /* HOM 12/23/91 */
@@ -1817,10 +1827,16 @@ int status;
return;
}
-#if defined(atarist) || (defined(OS2) && !defined(HAS_FORK))
+#if defined(atarist) || defined(OS2)
int pclose();
+#ifdef HAS_FORK
+int /* Cannot prototype with I32
+ in os2ish.h. */
+my_syspclose(ptr)
+#else
I32
my_pclose(ptr)
+#endif
PerlIO *ptr;
{
/* Needs work for PerlIO ! */