mirror of
https://git.busybox.net/busybox
synced 2026-02-15 22:16:09 +00:00
ash: main: Only set savestatus in exitcmd
Upstream commit:
Date: Sat, 19 May 2018 02:39:38 +0800
main: Only set savestatus in exitcmd
Currently exitcmd sets exitstatus and then savestatus if the latter
was previously set. In fact, as exitcmd always raises an exception
and will either end up in the setjmp call in main() or exitshell(),
where exitstatus is always replaced by savestatus if set, we only
need to set savestatus.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
4ccddc8fb3
commit
970470e235
1 changed files with 2 additions and 7 deletions
|
|
@ -13427,13 +13427,8 @@ exitcmd(int argc UNUSED_PARAM, char **argv)
|
|||
if (stoppedjobs())
|
||||
return 0;
|
||||
|
||||
if (argv[1]) {
|
||||
int status = number(argv[1]);
|
||||
|
||||
exitstatus = status;
|
||||
if (savestatus >= 0)
|
||||
savestatus = status;
|
||||
}
|
||||
if (argv[1])
|
||||
savestatus = number(argv[1]);
|
||||
|
||||
raise_exception(EXEXIT);
|
||||
/* NOTREACHED */
|
||||
|
|
|
|||
Loading…
Reference in a new issue