diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-25 20:49:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-25 20:49:53 +0200 |
commit | caee80cd3da65670a576e610044fdc5e7c957d6d (patch) | |
tree | b325ee52a3cc807712502173f235e15ca2d54718 | |
parent | 7aec86820d7bcf2842d167969c4fa7159ea643f7 (diff) | |
download | busybox-w32-caee80cd3da65670a576e610044fdc5e7c957d6d.tar.gz busybox-w32-caee80cd3da65670a576e610044fdc5e7c957d6d.tar.bz2 busybox-w32-caee80cd3da65670a576e610044fdc5e7c957d6d.zip |
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>
-rw-r--r-- | shell/ash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index b7f20ba36..3f1405d81 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13187,12 +13187,12 @@ exitshell(void) | |||
13187 | evalstring(p, 0); | 13187 | evalstring(p, 0); |
13188 | /*free(p); - we'll exit soon */ | 13188 | /*free(p); - we'll exit soon */ |
13189 | } | 13189 | } |
13190 | flush_stdout_stderr(); | ||
13191 | out: | 13190 | out: |
13192 | /* dash wraps setjobctl(0) in "if (setjmp(loc.loc) == 0) {...}". | 13191 | /* dash wraps setjobctl(0) in "if (setjmp(loc.loc) == 0) {...}". |
13193 | * our setjobctl(0) does not panic if tcsetpgrp fails inside it. | 13192 | * our setjobctl(0) does not panic if tcsetpgrp fails inside it. |
13194 | */ | 13193 | */ |
13195 | setjobctl(0); | 13194 | setjobctl(0); |
13195 | flush_stdout_stderr(); | ||
13196 | _exit(status); | 13196 | _exit(status); |
13197 | /* NOTREACHED */ | 13197 | /* NOTREACHED */ |
13198 | } | 13198 | } |