summaryrefslogtreecommitdiff
path: root/pp_sys.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 /pp_sys.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 'pp_sys.c')
-rw-r--r--pp_sys.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 73468e1713..9cfb67f999 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3491,6 +3491,7 @@ PP(pp_fork)
GV *tmpgv;
EXTEND(SP, 1);
+ PERL_FLUSHALL_FOR_CHILD;
childpid = fork();
if (childpid < 0)
RETSETUNDEF;
@@ -3559,6 +3560,7 @@ PP(pp_system)
TAINT_PROPER("system");
}
}
+ PERL_FLUSHALL_FOR_CHILD;
#if (defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(OS2)
while ((childpid = vfork()) == -1) {
if (errno != EAGAIN) {
@@ -3617,6 +3619,7 @@ PP(pp_exec)
I32 value;
STRLEN n_a;
+ PERL_FLUSHALL_FOR_CHILD;
if (PL_op->op_flags & OPf_STACKED) {
SV *really = *++MARK;
value = (I32)do_aexec(really, MARK, SP);