summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-31 22:39:34 +0000
committerjbj <devnull@localhost>2002-08-31 22:39:34 +0000
commitcc5d229b0e7a13f4d9efac2aed5926a0078df48c (patch)
treeb5a1a608498f322dad0cd9534ccd9da4c121b3a0 /rpmdb
parent929d5d38346273dbdaf20e5ceb3b1687405676af (diff)
downloadlibrpm-tizen-cc5d229b0e7a13f4d9efac2aed5926a0078df48c.tar.gz
librpm-tizen-cc5d229b0e7a13f4d9efac2aed5926a0078df48c.tar.bz2
librpm-tizen-cc5d229b0e7a13f4d9efac2aed5926a0078df48c.zip
Sync with rpm-4.1.
CVS patchset: 5695 CVS date: 2002/08/31 22:39:34
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/Makefile.am4
-rw-r--r--rpmdb/header.c2
-rw-r--r--rpmdb/rpmdb.c42
-rw-r--r--rpmdb/rpmdb.h8
4 files changed, 29 insertions, 27 deletions
diff --git a/rpmdb/Makefile.am b/rpmdb/Makefile.am
index 7fdc485a0..9201924fc 100644
--- a/rpmdb/Makefile.am
+++ b/rpmdb/Makefile.am
@@ -28,7 +28,7 @@ mylibpaths = \
-L$(top_builddir)/rpmio \
-L$(top_builddir)/popt
-mylibs = -lrpm -lrpmio -lpopt @WITH_LIBELF_LIB@ @LIBS@ @INTLLIBS@ @LIBMISC@
+mylibs = -lrpm -lrpmio -lpopt @LIBS@ @INTLLIBS@ @LIBMISC@
LIBS =
DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs)
@@ -40,7 +40,7 @@ librpmdb_la_SOURCES = \
poptDB.c rpmhash.c rpmdb.c \
tagname.c tagtbl.c
librpmdb_la_LDFLAGS = -release @VERSION@ @libdb3@
-librpmdb_la_LIBADD = $(DBLIBOBJS) $(DB3LOBJS)
+librpmdb_la_LIBADD = $(DBLIBOBJS) $(DB3LOBJS) @WITH_LIBELF_LIB@
librpmdb_la_DEPENDENCIES = $(DBLIBOBJS) .created
# XXX make sure that db.h symlink is generated
diff --git a/rpmdb/header.c b/rpmdb/header.c
index 663c6f4da..9ecaa416f 100644
--- a/rpmdb/header.c
+++ b/rpmdb/header.c
@@ -17,7 +17,7 @@
#include "debug.h"
/*@unchecked@*/
-int _hdr_debug = 1;
+int _hdr_debug = 0;
/*@-redecl@*/ /* FIX: avoid rpmlib.h, need for debugging. */
/*@observer@*/ const char *const tagName(int tag) /*@*/;
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index 37b818747..6ccc290ed 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -687,15 +687,11 @@ static int enableSignals(void)
}
/*@unchecked@*/
-static rpmdb dbrock;
+static rpmdb rpmdbRock;
-/**
- * Check for signals.
- */
-/*@mayexit@*/
-static int checkSignals(void)
- /*@globals dbrock, satbl, fileSystem @*/
- /*@modifies dbrock, fileSystem @*/
+int rpmdbCheckSignals(void)
+ /*@globals rpmdbRock, satbl @*/
+ /*@modifies rpmdbRock @*/
{
struct sigtbl_s * tbl;
sigset_t newMask, oldMask;
@@ -714,8 +710,8 @@ static int checkSignals(void)
rpmdb db;
rpmMessage(RPMMESS_WARNING, "Exiting on signal ...\n");
/*@-newreftrans@*/
- while ((db = dbrock) != NULL) {
-/*@i@*/ dbrock = db->db_next;
+ while ((db = rpmdbRock) != NULL) {
+/*@i@*/ rpmdbRock = db->db_next;
db->db_next = NULL;
(void) rpmdbClose(db);
}
@@ -773,10 +769,10 @@ static int blockSignals(/*@unused@*/ rpmdb db, /*@out@*/ sigset_t * oldMask)
*/
/*@mayexit@*/
static int unblockSignals(/*@unused@*/ rpmdb db, sigset_t * oldMask)
- /*@globals dbrock, fileSystem @*/
- /*@modifies dbrock, fileSystem @*/
+ /*@globals rpmdbRock, fileSystem @*/
+ /*@modifies rpmdbRock, fileSystem @*/
{
- (void) checkSignals();
+ (void) rpmdbCheckSignals();
return sigprocmask(SIG_SETMASK, oldMask, NULL);
}
@@ -842,8 +838,8 @@ int rpmdbCloseDBI(rpmdb db, int rpmtag)
/* XXX query.c, rpminstall.c, verify.c */
/*@-incondefs@*/
int rpmdbClose(rpmdb db)
- /*@globals dbrock @*/
- /*@modifies dbrock @*/
+ /*@globals rpmdbRock @*/
+ /*@modifies rpmdbRock @*/
{
rpmdb * prev, next;
int dbix;
@@ -876,7 +872,7 @@ int rpmdbClose(rpmdb db)
db->_dbi = _free(db->_dbi);
/*@-newreftrans@*/
- prev = &dbrock;
+ prev = &rpmdbRock;
while ((next = *prev) != NULL && next != db)
prev = &next->db_next;
if (next) {
@@ -968,9 +964,9 @@ static int openDatabase(/*@null@*/ const char * prefix,
/*@null@*/ const char * dbpath,
int _dbapi, /*@null@*/ /*@out@*/ rpmdb *dbp,
int mode, int perms, int flags)
- /*@globals dbrock, rpmGlobalMacroContext,
+ /*@globals rpmdbRock, rpmGlobalMacroContext,
fileSystem, internalState @*/
- /*@modifies dbrock, *dbp, rpmGlobalMacroContext,
+ /*@modifies rpmdbRock, *dbp, rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@requires maxSet(dbp) >= 0 @*/
{
@@ -1055,8 +1051,8 @@ exit:
xx = rpmdbClose(db);
else {
/*@-assignexpose -newreftrans@*/
-/*@i@*/ db->db_next = dbrock;
- dbrock = db;
+/*@i@*/ db->db_next = rpmdbRock;
+ rpmdbRock = db;
/*@i@*/ *dbp = db;
/*@=assignexpose =newreftrans@*/
}
@@ -1700,7 +1696,7 @@ rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
mi->mi_db = rpmdbUnlink(mi->mi_db, "matchIterator");
mi = _free(mi);
- (void) checkSignals();
+ (void) rpmdbCheckSignals();
return mi;
}
@@ -2142,8 +2138,6 @@ Header rpmdbNextIterator(rpmdbMatchIterator mi)
if (mi == NULL)
return NULL;
- (void) checkSignals();
-
dbi = dbiOpen(mi->mi_db, RPMDBI_PACKAGES, 0);
if (dbi == NULL)
return NULL;
@@ -2441,7 +2435,7 @@ rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag rpmtag,
if (db == NULL)
return NULL;
- (void) checkSignals();
+ (void) rpmdbCheckSignals();
/* XXX HACK to remove rpmdbFindByLabel/findMatches from the API */
if (rpmtag == RPMDBI_LABEL) {
diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h
index 7314b1791..a9175df9b 100644
--- a/rpmdb/rpmdb.h
+++ b/rpmdb/rpmdb.h
@@ -1018,6 +1018,14 @@ Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi)
/*@modifies mi, rpmGlobalMacroContext, fileSystem @*/;
/** \ingroup rpmdb
+ * Check rpmdb signal handler for trapped signal exit.
+ */
+/*@mayexit@*/
+int rpmdbCheckSignals(void)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
+
+/** \ingroup rpmdb
* Destroy rpm database iterator.
* @param mi rpm database iterator
* @return NULL always