Hi Walter,
On Fri, 25 Aug 2017, walter harms wrote:
> Am 24.08.2017 13:19, schrieb Denys Vlasenko:
>
> > +/*
> > + * Returns 0 if xargs should continue (but may set G.xargs_exitcode to
> > 123).
> > + * Else sets G.xargs_exitcode to error code and returns nonzero.
> > + *
> > + * If G.max_procs == 0, performs final waitpid() loop for all children.
> > + */
> > static int xargs_exec(void)
> > {
> > int status;
> > [..]
> > + } else {
> > + /* final waitpid() loop: must be ECHILD "no more children" */
> > + status = 0;
> > + }
>
> maybe you can make it a function returning status ?
> that would improve readability.
No, it would not, as the status has to be interpreted in a very specific
way: first, you have to update the global exit status, but only if it was
indicating a less serious error (or no error at all), and then you have to
either continue or stop based on the value.
What Denys wrote separates the concern of updating the global status from
determining whether to continue or not.
Ciao,
Johannes
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox