ash: return exit status of nofork applets
authorRon Yorston <rmy@pobox.com>
Thu, 20 Oct 2016 11:24:02 +0000 (12:24 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 23 Oct 2016 23:18:13 +0000 (01:18 +0200)
The commit 'ash: eval: Return status in eval functions' changed how
exit status is handled in eval functions.  The case of nofork
applets was missed, resulting in the incorrect status potentially
being returned for nofork applets when FEATURE_SH_NOFORK is enabled.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index 50f479d1a9d2648eed63641e9d1e06540cb35b36..c9d39b875b17cbc59d7d4b768fed8499e67fdfa9 100644 (file)
@@ -9576,7 +9576,7 @@ evalcommand(union node *cmd, int flags)
                if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) {
                        listsetvar(varlist.list, VEXPORT|VSTACK);
                        /* run <applet>_main() */
-                       exitstatus = run_nofork_applet(applet_no, argv);
+                       status = run_nofork_applet(applet_no, argv);
                        break;
                }
 #endif