[PATCH 3/3] platform: fix missing sigisemptyset

Denys Vlasenko vda.linux at googlemail.com
Thu Nov 28 02:19:03 UTC 2013

On Thursday 28 November 2013 02:01, Rich Felker wrote:
> > I would say it's better to open-code a conditional replacement everywhere
> > sigisemptyset is used (total of two callsites): usually, the caller expects
> > not-braindead looping implementation.
> At least in hush, the problem is that busybox is using sigset_t not as
> part of an interface to the standard library functions that use it,
> but to store its own internal representation of which signals it's
> seen, then stuck with the fact that the standard sigset_t API (which
> lacks sigisemptyset) can't efficiently provide it the information it
> wants. Of course this may still be a reasonable trade-off since
> reusing the sigset_t API is size-efficient and the code is probably
> not performance-critical.

hush can set a flag variable:

static void record_pending_signo(int sig)
        sigaddset(&G.pending_set, sig);
+	G.pending_set_is_not_empty = 1;

and check it instead of sigisemptyset(&G.pending_set)

More information about the busybox mailing list