summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2016-12-13 08:48:53 +0200
committerPanu Matilainen <pmatilai@redhat.com>2017-02-16 11:54:14 +0200
commit43734896d326c9a098d5dd221ad4cf772d82e50f (patch)
treebb424a6bd6f6710386c167f1bf05ecc7a9372f90
parent73fc06478a750260d097165f064d9cc354cf506f (diff)
downloadrpm-43734896d326c9a098d5dd221ad4cf772d82e50f.tar.gz
Revert "rpmdb.c: (rpmdbCheckTerminate) return non-zero on subsequent runs"
The change seems logical enough, but that doesn't work when the surrounding code is not. rpmdbCheckTerminate() is an idiotic API by yours truly which must return non-zero exactly once because that's the signal for the *caller* to call exit() (did I already say idiotic?) Anyway, if it repeatedly returns non-zero rpm will exit() more than once which at least glibc seems to take as "so lets exit already shall we?" This reverts commit e5d3b9f682383ee026b5a86a47eb5f288bdf8991. (cherry picked from commit 1200b98efd8f9d15417168cd4251151125e56944)
-rw-r--r--lib/rpmdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index 2dd368432..7acf14a22 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -315,7 +315,7 @@ int rpmdbCheckTerminate(int terminate)
sigset_t newMask, oldMask;
static int terminating = 0;
- if (terminating) return terminating;
+ if (terminating) return 0;
(void) sigfillset(&newMask); /* block all signals */
(void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);