diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2003-03-17 11:28:56 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2003-03-17 11:28:56 +0000 |
commit | 5821bf03d81120838cb39866be0475398255b540 (patch) | |
tree | 2b6af6f321f1af4d63e77ab122d57739e13c4a15 /bin | |
parent | 2ad2651a98ce689790699f7fb7d1e6bfc9429f3f (diff) | |
download | src-5821bf03d81120838cb39866be0475398255b540.tar.gz src-5821bf03d81120838cb39866be0475398255b540.zip |
Flush the output buffers before forking a child process to avoid
the child process writing data that the parent should have written.
PR: 50051
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=112341
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/jobs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index 0c1518d06599..f8ecbf888290 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -740,6 +740,7 @@ forkshell(struct job *jp, union node *n, int mode) TRACE(("forkshell(%%%d, 0x%lx, %d) called\n", jp - jobtab, (long)n, mode)); INTOFF; + flushall(); pid = fork(); if (pid == -1) { TRACE(("Fork failed, errno=%d\n", errno)); |