summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2016-12-15 12:16:41 +0200
committerPanu Matilainen <pmatilai@redhat.com>2016-12-15 12:16:41 +0200
commit07620f4ae7b626e6e02d743b1e933cf909ad0eb2 (patch)
tree818c0d2d751a6637cf2e4a7cf937d4a435117073
parentb275b940619bd8add69f89dc2cb55920c3915a7a (diff)
downloadrpm-07620f4ae7b626e6e02d743b1e933cf909ad0eb2.tar.gz
Honor blocked signals during rpmsqPoll() too
Queued signals might get processed much much later than they arrive, and almost anything can happen in the meanwhile. Such as program blocking signals before entering a critical piece of code, which routinely calls rpmsqPoll() underneath since the code is not always critical. Such as rpmdb iterator init/free - sometimes they're called during harmless read-only query, at other times they're in middle of transaction...
-rw-r--r--rpmio/rpmsq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c
index c2efb4714..0eb3ca37a 100644
--- a/rpmio/rpmsq.c
+++ b/rpmio/rpmsq.c
@@ -143,6 +143,9 @@ int rpmsqPoll(void)
(void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);
for (rpmsig tbl = rpmsigTbl; tbl->signum >= 0; tbl++) {
+ /* honor blocked signals in polling too */
+ if (sigismember(&oldMask, tbl->signum))
+ continue;
if (sigismember(&rpmsqCaught, tbl->signum)) {
rpmsqAction_t handler = (tbl->handler != NULL) ? tbl->handler :
tbl->defhandler;