Add rpmsqIsCaught() for testing if a signal has been caught

This commit is contained in:
Panu Matilainen 2008-06-03 12:04:57 +03:00
parent df206dbaaf
commit cd040ba59b
2 changed files with 13 additions and 0 deletions

View File

@ -171,6 +171,11 @@ static struct rpmsig_s {
{ -1, NULL },
};
int rpmsqIsCaught(int signum)
{
return sigismember(&rpmsqCaught, signum);
}
void rpmsqAction(int signum,
void * info, void * context)
{

View File

@ -53,6 +53,14 @@ struct rpmsqElem {
extern sigset_t rpmsqCaught;
/** \ingroup rpmsq
* Test if given signal has been caught (while signals blocked).
* Similar to sigismember() but operates on internal signal queue.
* @param signum signal to test for
* @return 1 if caught, 0 if not and -1 on error
*/
int rpmsqIsCaught(int signum);
/** \ingroup rpmsq
* Default signal handler.
* @param signum signal number