ash: return exit status of nofork applets (again)
Since commitd81af7216
(ash: eval: Reap zombies after built-in commands and functions) if the shell is compiled with SH_STANDALONE and SH_NOFORK enabled nofork applets potentially return the incorrect status. The status value returned by evalcommand() in this case is obtained from exitstatus in a call to waitforjob(NULL). This overwrites the status set for nonfork applets. If this commit seems familiar it's essentially a reversion of commit5ccb0e92fa
(ash: return exit status of nofork applets). What was correct in 2016 is wrong in 2020 and vice versa. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
ecc85832f8
commit
d5bfe26c45
@ -10351,7 +10351,7 @@ evalcommand(union node *cmd, int flags)
|
|||||||
* and/or wait for user input ineligible for NOFORK:
|
* and/or wait for user input ineligible for NOFORK:
|
||||||
* for example, "yes" or "rm" (rm -i waits for input).
|
* for example, "yes" or "rm" (rm -i waits for input).
|
||||||
*/
|
*/
|
||||||
status = run_nofork_applet(applet_no, argv);
|
exitstatus = run_nofork_applet(applet_no, argv);
|
||||||
environ = sv_environ;
|
environ = sv_environ;
|
||||||
/*
|
/*
|
||||||
* Try enabling NOFORK for "yes" applet.
|
* Try enabling NOFORK for "yes" applet.
|
||||||
|
Loading…
Reference in New Issue
Block a user