|
Panu Matilainen |
0d72de |
commit 36f6874fcf5222f4553fb5b7782af18c7b6ea92a
|
|
Panu Matilainen |
0d72de |
Author: Panu Matilainen <pmatilai@redhat.com>
|
|
Panu Matilainen |
0d72de |
Date: Fri Apr 15 09:18:15 2011 +0300
|
|
Panu Matilainen |
0d72de |
|
|
Panu Matilainen |
0d72de |
Only muck with signals on first and last db open/close
|
|
Panu Matilainen |
0d72de |
- Signals are per-process global, as long as there are other
|
|
Panu Matilainen |
0d72de |
databases open (or references to the same db) we shouldn't mess
|
|
Panu Matilainen |
0d72de |
with them. Less important on open, but if somebody is changing
|
|
Panu Matilainen |
0d72de |
rpmsq-handling we shouldn't override that either.
|
|
Panu Matilainen |
0d72de |
(cherry picked from commit dcf650f5a73846773c7b81de08e2608391f733b8)
|
|
Panu Matilainen |
0d72de |
|
|
Panu Matilainen |
0d72de |
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
|
|
Panu Matilainen |
0d72de |
index 50bb6b1..44cdb2b 100644
|
|
Panu Matilainen |
0d72de |
--- a/lib/rpmdb.c
|
|
Panu Matilainen |
0d72de |
+++ b/lib/rpmdb.c
|
|
Panu Matilainen |
0d72de |
@@ -661,12 +661,14 @@ int rpmdbClose(rpmdb db)
|
|
Panu Matilainen |
0d72de |
|
|
Panu Matilainen |
0d72de |
db = _free(db);
|
|
Panu Matilainen |
0d72de |
|
|
Panu Matilainen |
0d72de |
+ if (rpmdbRock == NULL) {
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(-SIGHUP, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(-SIGINT, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(-SIGTERM, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(-SIGQUIT, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(-SIGPIPE, NULL);
|
|
Panu Matilainen |
0d72de |
+ }
|
|
Panu Matilainen |
0d72de |
exit:
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(-SIGHUP, NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(-SIGINT, NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(-SIGTERM,NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(-SIGQUIT,NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(-SIGPIPE,NULL);
|
|
Panu Matilainen |
0d72de |
return rc;
|
|
Panu Matilainen |
0d72de |
}
|
|
Panu Matilainen |
0d72de |
|
|
Panu Matilainen |
0d72de |
@@ -728,11 +730,13 @@ static int openDatabase(const char * prefix,
|
|
Panu Matilainen |
0d72de |
/* Try to ensure db home exists, error out if we cant even create */
|
|
Panu Matilainen |
0d72de |
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
|
|
Panu Matilainen |
0d72de |
if (rc == 0) {
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(SIGHUP, NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(SIGINT, NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(SIGTERM,NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(SIGQUIT,NULL);
|
|
Panu Matilainen |
0d72de |
- (void) rpmsqEnable(SIGPIPE,NULL);
|
|
Panu Matilainen |
0d72de |
+ if (rpmdbRock == NULL) {
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(SIGHUP, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(SIGINT, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(SIGTERM, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(SIGQUIT, NULL);
|
|
Panu Matilainen |
0d72de |
+ (void) rpmsqEnable(SIGPIPE, NULL);
|
|
Panu Matilainen |
0d72de |
+ }
|
|
Panu Matilainen |
0d72de |
|
|
Panu Matilainen |
0d72de |
/* Just the primary Packages database opened here */
|
|
Panu Matilainen |
0d72de |
rc = (rpmdbOpenIndex(db, RPMDBI_PACKAGES, db->db_flags) != NULL) ? 0 : -2;
|