Re: [PATCH 2/2] shell: fix for 'wait -n' return 127 when nothing to wait

"Roberto A. Foglietta via busybox" <[email protected]>
Newsgroups gmane.linux.busybox
Message-ID <CAJGKYO51-45RJ2=xh90V9bmhGKth_6FJHUg-oEokKbknqsuKxg@mail.gmail.com>
On Sun, 29 Mar 2026 at 21:16, Luiz Angelo Daros de Luca
<[email protected]> wrote:
>
> > On Thu, 6 Nov 2025 at 23:57, Dominique Martinet <[email protected]> wrote:
> > >
> > > From: Dominique Martinet <[email protected]>
> > >
> > > wait -n would only return 127 if there is no job, not if there is no job
> > > not accounted for.
> > >
> >
> > Hi,
> > I have applied the patch from Luiz just because he was the last one to
> > submit on that topic (ash wait) but I realised that the BASH_WAIT_N
> > symbol is undefined and it has no corresponding voice in the
> > menuconfig.
>
> Hi,
>
> BASH_WAIT_N is set by ENABLE_ASH_BASH_COMPAT value in ash.c. Just grep
> for it and check the first occurrence.

Found it:

+:git-shell:bugfixes:busybox> sw e48559eae
commit e48559eae3ba10e4b4f4c2ce726c31fd038a37ba
Author: Ron Yorston <[email protected]>
Date:   Sun Mar 31 09:27:09 2019 +0100

    ash: distinguish 'wait -n' from other bashisms

>
> > Are these patches in any manner related?
>
> Fixing similar issues but I wasn't aware of it. I just checked
> bugzilla for similar issues but it was a partial search as bugzilla
> and the site itself was very unstable these days. Most of my searches
> were using external cached pages.
>
> > Or are two independent approaches to the same issue?
>
> Yes, independent. Sorry I missed the Dominique Martinet patch series.
>

I tried to integrate your patch with the others but it isn't a trivial
task, thus postponed.

https://github.com/robang74/busybox/commits/bugfixes/

commit 2de3e5d1cd94ddc3c044044dcddf0711241b3ab9
Author: Roberto A. Foglietta <[email protected]>
Date:   Sun Mar 29 22:06:55 2026 +0200

    ash: fix wait -n behavior for PIDs, reverted back but test files

    ash: shell/ash_test/ash-misc/wait_n1/2 test/right files

    Status: not peer-reviewed yet, patch did not applied cleanly.

    Explanation: patch doesn't apply cleanly and conflicts with a previous
            set of two patches which were tested and applies cleanly to
            ash.c and under these circumstances [email protected] is the
            best one that can deliver an integration patch because it isn't
            trivial to merge the three. Test cases integrated, instead.

Best regards, R-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.