[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] ash: return exit status of nofork applets (again)
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2020-02-20 9:52:21
Message-ID: CAK1hOcOHTN1BN=cEWpUsqG2EL+YSoWAdb=iw0aYaiQ1OjdmGJA () mail ! gmail ! com
[Download RAW message or body]

Applied, thanks!

On Thu, Feb 20, 2020 at 9:23 AM Ron Yorston <rmy@pobox.com> wrote:
>
> Since commit d81af7216 (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 commit
> 5ccb0e92fa (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>
> ---
>  shell/ash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/shell/ash.c b/shell/ash.c
> index fea4b10a7..0f6f7a733 100644
> --- a/shell/ash.c
> +++ b/shell/ash.c
> @@ -10349,7 +10349,7 @@ evalcommand(union node *cmd, int flags)
>                          * and/or wait for user input ineligible for NOFORK:
>                          * 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;
>                         /*
>                          * Try enabling NOFORK for "yes" applet.
> --
> 2.24.1
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic