summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2016-10-25 20:49:53 +0200
committerDenys Vlasenko2016-10-25 20:49:53 +0200
commitcaee80cd3da65670a576e610044fdc5e7c957d6d (patch)
treeb325ee52a3cc807712502173f235e15ca2d54718 /shell
parent7aec86820d7bcf2842d167969c4fa7159ea643f7 (diff)
downloadbusybox-caee80cd3da65670a576e610044fdc5e7c957d6d.zip
busybox-caee80cd3da65670a576e610044fdc5e7c957d6d.tar.gz
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>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index b7f20ba..3f1405d 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -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 */
}