diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-06-03 12:04:57 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-06-03 12:04:57 +0300 |
commit | cd040ba59b00ce709fa97016df9eaf733adc1ccf (patch) | |
tree | ab7392a076eaf60e336d4987de074b9f26ac931a | |
parent | df206dbaaf59af1c4879ecd3739f2cf9a46e48af (diff) | |
download | rpm-cd040ba59b00ce709fa97016df9eaf733adc1ccf.tar.gz rpm-cd040ba59b00ce709fa97016df9eaf733adc1ccf.tar.bz2 rpm-cd040ba59b00ce709fa97016df9eaf733adc1ccf.zip |
Add rpmsqIsCaught() for testing if a signal has been caught
-rw-r--r-- | rpmio/rpmsq.c | 5 | ||||
-rw-r--r-- | rpmio/rpmsq.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c index 160329aa6..6d866266f 100644 --- a/rpmio/rpmsq.c +++ b/rpmio/rpmsq.c @@ -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) { diff --git a/rpmio/rpmsq.h b/rpmio/rpmsq.h index 796ecb203..32246508e 100644 --- a/rpmio/rpmsq.h +++ b/rpmio/rpmsq.h @@ -54,6 +54,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 * @param info (siginfo_t) signal info |