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
This commit is contained in:
parent
ad732803d1
commit
a06bef7adb
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user