Re: [PATCH 1/3] signals: sigqueue_free: don't free sigqueue if it is queued

From: Roland McGrath
Date: Thu May 22 2008 - 17:52:21 EST


> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/