From 836d4a749ea9bdd1627376760fe7cb2222858390 Mon Sep 17 00:00:00 2001 From: tjr Date: Mon, 17 Mar 2003 11:28:56 +0000 Subject: 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 --- bin/sh/jobs.c | 1 + 1 file changed, 1 insertion(+) 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)); -- cgit v1.1