_60 & _04 - Add WRITE & CLOSE to TIEHANDLE
[p5sagit/p5-mst-13.2.git] / os2 / os2.c
index fe7f99b..f24c3af 100644 (file)
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -620,8 +620,6 @@ char        *mode;
     PerlIO *res;
     SV *sv;
     
-    if (pipe(p) < 0)
-       return Nullfp;
     /* `this' is what we use in the parent, `that' in the child. */
     this = (*mode == 'w');
     that = !this;
@@ -629,6 +627,8 @@ char        *mode;
        taint_env();
        taint_proper("Insecure %s%s", "EXEC");
     }
+    if (pipe(p) < 0)
+       return Nullfp;
     /* Now we need to spawn the child. */
     newfd = dup(*mode == 'r');         /* Preserve std* */
     if (p[that] != (*mode == 'r')) {