diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2016-12-15 12:40:31 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2016-12-15 12:40:31 +0200 |
commit | 4edaafc26fc4338ad25e993ef381aae3252dd7db (patch) | |
tree | bf342492aa249a18ea44d1a39a43f1a6469078d4 | |
parent | 07620f4ae7b626e6e02d743b1e933cf909ad0eb2 (diff) | |
download | rpm-4edaafc26fc4338ad25e993ef381aae3252dd7db.tar.gz |
Remember the first signal to arrive, not last
This is more in line with how "normal" signals behave - if a signal
of the same type is already pending then the subsequent signals of
that type are dropped.
-rw-r--r-- | rpmio/rpmsq.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c index 0eb3ca37a..1d0e73a6c 100644 --- a/rpmio/rpmsq.c +++ b/rpmio/rpmsq.c @@ -70,10 +70,12 @@ static void rpmsqHandler(int signum, siginfo_t * info, void * context) int save = errno; if (sigismember(&rpmsqActive, signum)) { - rpmsig sig = NULL; - (void) sigaddset(&rpmsqCaught, signum); - if (rpmsigGet(signum, &sig)) - memcpy(&sig->siginfo, info, sizeof(*info)); + if (!sigismember(&rpmsqCaught, signum)) { + rpmsig sig = NULL; + (void) sigaddset(&rpmsqCaught, signum); + if (rpmsigGet(signum, &sig)) + memcpy(&sig->siginfo, info, sizeof(*info)); + } } errno = save; |