2006-12-19 00:17:44 +01:00
|
|
|
Do not block signals if the database is opened read-only, it jst
|
2006-12-19 00:17:44 +01:00
|
|
|
annoys the users. [#48026]
|
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: rpmdb/rpmdb.c
|
|
|
|
===================================================================
|
|
|
|
--- rpmdb/rpmdb.c.orig
|
|
|
|
+++ rpmdb/rpmdb.c
|
|
|
|
@@ -873,10 +873,12 @@ int rpmdbClose(rpmdb db)
|
2006-12-19 00:17:44 +01:00
|
|
|
rpmdb * prev, next;
|
2006-12-19 00:17:44 +01:00
|
|
|
int dbix;
|
2006-12-19 00:17:44 +01:00
|
|
|
int rc = 0;
|
|
|
|
+ int dbmode;
|
|
|
|
|
|
|
|
if (db == NULL)
|
|
|
|
goto exit;
|
|
|
|
|
|
|
|
+ dbmode = db->db_mode;
|
2006-12-19 00:17:44 +01:00
|
|
|
(void) rpmdbUnlink(db, "rpmdbClose");
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2006-12-19 00:17:44 +01:00
|
|
|
/*@-usereleased@*/
|
2008-09-12 20:37:28 +02:00
|
|
|
@@ -913,12 +915,14 @@ int rpmdbClose(rpmdb db)
|
2006-12-19 00:17:44 +01:00
|
|
|
/*@-refcounttrans@*/ db = _free(db); /*@=refcounttrans@*/
|
|
|
|
/*@=usereleased@*/
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
+ if ((dbmode & (O_RDWR|O_WRONLY)) != 0) {
|
|
|
|
+ (void) rpmsqEnable(-SIGHUP, NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGINT, NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGTERM,NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGQUIT,NULL);
|
|
|
|
+ (void) rpmsqEnable(-SIGPIPE,NULL);
|
|
|
|
+ }
|
2006-12-19 00:17:44 +01:00
|
|
|
exit:
|
|
|
|
- (void) rpmsqEnable(-SIGHUP, NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGINT, NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGTERM,NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGQUIT,NULL);
|
|
|
|
- (void) rpmsqEnable(-SIGPIPE,NULL);
|
2006-12-19 00:17:44 +01:00
|
|
|
return rc;
|
|
|
|
}
|
2006-12-19 00:17:44 +01:00
|
|
|
/*@=incondefs@*/
|
2008-09-12 20:37:28 +02:00
|
|
|
@@ -1050,11 +1054,13 @@ static int openDatabase(/*@null@*/ const
|
2006-12-19 00:17:44 +01:00
|
|
|
if (db == NULL)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
- (void) rpmsqEnable(SIGHUP, NULL);
|
|
|
|
- (void) rpmsqEnable(SIGINT, NULL);
|
|
|
|
- (void) rpmsqEnable(SIGTERM,NULL);
|
|
|
|
- (void) rpmsqEnable(SIGQUIT,NULL);
|
|
|
|
- (void) rpmsqEnable(SIGPIPE,NULL);
|
|
|
|
+ if ((db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
|
|
|
|
+ (void) rpmsqEnable(SIGHUP, NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGINT, NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGTERM,NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGQUIT,NULL);
|
|
|
|
+ (void) rpmsqEnable(SIGPIPE,NULL);
|
|
|
|
+ }
|
2009-08-28 15:54:03 +02:00
|
|
|
|
2006-12-19 00:17:44 +01:00
|
|
|
db->db_api = _dbapi;
|
2011-05-16 18:07:44 +02:00
|
|
|
|