summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-09 22:47:39 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-09 22:47:39 +0000
commit45bc920620377d5a7720d3d562c48df1eb0c2e68 (patch)
treeddf80cf0881964ffc19fe3b1f195ebfb7cc09284 /util.c
parent46a8855a50eb32c89dd161fbf5c3956ca0e452d8 (diff)
downloadperl-45bc920620377d5a7720d3d562c48df1eb0c2e68.tar.gz
flush all open output buffers before fork(), exec(), system, qx//
and pipe open() operations, simplifying buffering headaches faced by users; uses fflush(NULL), which may need Configure test p4raw-id: //depot/perl@3352
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util.c b/util.c
index 2794364d88..31e9c39178 100644
--- a/util.c
+++ b/util.c
@@ -1911,6 +1911,7 @@ my_popen(char *cmd, char *mode)
SV *sv;
I32 doexec = strNE(cmd,"-");
+ PERL_FLUSHALL_FOR_CHILD;
#ifdef OS2
if (doexec) {
return my_syspopen(cmd,mode);
@@ -1984,12 +1985,11 @@ my_popen(char *cmd, char *mode)
#if defined(atarist) || defined(DJGPP)
FILE *popen();
PerlIO *
-my_popen(cmd,mode)
-char *cmd;
-char *mode;
+my_popen(char *cmd, char *mode)
{
/* Needs work for PerlIO ! */
/* used 0 for 2nd parameter to PerlIO-exportFILE; apparently not used */
+ PERL_FLUSHALL_FOR_CHILD;
return popen(PerlIO_exportFILE(cmd, 0), mode);
}
#endif