ash: [SHELL] Move flushall to the point just before _exit

Upstream commit:

    We need to flush at the very end in case we've generated any errors
    before that.  The flushall call cannot perform a longjmp so it's
    safe there.

    Date: Sat, 22 Sep 2007 20:50:21 +0800
    [SHELL] Move flushall to the point just before _exit

    We need to flush at the very end in case we've generated any errors
    before that.  The flushall call cannot perform a longjmp so it's
    safe there.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-10-25 20:49:53 +02:00
parent 7aec86820d
commit caee80cd3d

View File

@ -13187,12 +13187,12 @@ exitshell(void)
evalstring(p, 0);
/*free(p); - we'll exit soon */
}
flush_stdout_stderr();
out:
/* dash wraps setjobctl(0) in "if (setjmp(loc.loc) == 0) {...}".
* our setjobctl(0) does not panic if tcsetpgrp fails inside it.
*/
setjobctl(0);
flush_stdout_stderr();
_exit(status);
/* NOTREACHED */
}