diff options
author | tjr <tjr@FreeBSD.org> | 2003-03-17 11:28:56 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-03-17 11:28:56 +0000 |
commit | 836d4a749ea9bdd1627376760fe7cb2222858390 (patch) | |
tree | 2b6af6f321f1af4d63e77ab122d57739e13c4a15 | |
parent | 884a12a930bfdf3153ad6663b0ccf56a3532b264 (diff) | |
download | FreeBSD-src-836d4a749ea9bdd1627376760fe7cb2222858390.zip FreeBSD-src-836d4a749ea9bdd1627376760fe7cb2222858390.tar.gz |
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
-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 0c1518d..f8ecbf8 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)); |