perlfaq typos
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index d39ecb6..8fa38f2 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -572,7 +572,10 @@ PP(pp_pipe_op)
        else PerlLIO_close(fd[1]);
        goto badexit;
     }
-
+#if defined(HAS_FCNTL) && defined(F_SETFD)
+    fcntl(fd[0],F_SETFD,fd[0] > PL_maxsysfd);  /* ensure close-on-exec */
+    fcntl(fd[1],F_SETFD,fd[1] > PL_maxsysfd);  /* ensure close-on-exec */
+#endif
     RETPUSHYES;
 
 badexit: