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

List:       busybox
Subject:    Re: [PATCH 3/3] platform: fix missing sigisemptyset
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2013-11-28 2:19:03
Message-ID: 201311280319.03729.vda.linux () googlemail ! com
[Download RAW message or body]

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)
_______________________________________________
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