Messages in this thread | | | From | Roland McGrath <> | Subject | Re: [PATCH 1/3] signals: sigqueue_free: don't free sigqueue if it is queued | Date | Thu, 22 May 2008 14:50:57 -0700 (PDT) |
| |
> This is not enough. Again, we remove and free sigqueue but don't discard > the pending signal. (and we must take into account other rt signals with > the same si_signo if we want to discard the signal).
Right, of course. The sigset_t collecting while checking the queue is the only way to do it. Note that you need to make it:
if (q->info.si_code == SI_TIMER && sig >= SIGRTMIN)
because a SI_TIMER could be using a legacy_queue signal number. In that case there might have been a second non-timer signal pending with that number too, which must not get cleared. Since the only siginfo_t still recorded is the SI_TIMER one, better to leave it queued than turn it into an infoless signal, seems to me.
Thanks, Roland
| |