} * miRE;
struct _rpmdbMatchIterator {
+/*@dependent@*/ /*@null@*/
rpmdbMatchIterator mi_next;
/*@only@*/
const void * mi_keyp;
/*@unchecked@*/
static rpmdb rpmdbRock;
-/*@unchecked@*/
-static rpmdbMatchIterator rpmmiRock = NULL;
+/*@unchecked@*/ /*@exposed@*/ /*@null@*/
+static rpmdbMatchIterator rpmmiRock;
int rpmdbCheckSignals(void)
- /*@globals rpmdbRock, satbl @*/
- /*@modifies rpmdbRock @*/
+ /*@globals rpmdbRock, rpmmiRock, satbl @*/
+ /*@modifies rpmdbRock, rpmmiRock @*/
{
struct sigtbl_s * tbl;
sigset_t newMask, oldMask;
- int terminate = 0;
+ static int terminate = 0;
+
+ if (terminate) return 0;
(void) sigfillset(&newMask); /* block all signals */
(void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);
rpmMessage(RPMMESS_DEBUG, "Exiting on signal ...\n");
+/*@-branchstate@*/
while ((mi = rpmmiRock) != NULL) {
/*@i@*/ rpmmiRock = mi->mi_next;
mi->mi_next = NULL;
- mi = rpmdbFreeIterator(mi);
+/*@i@*/ mi = rpmdbFreeIterator(mi);
}
+/*@=branchstate@*/
/*@-newreftrans@*/
while ((db = rpmdbRock) != NULL) {
}
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
+ /*@globals rpmmiRock @*/
+ /*@modifies rpmmiRock @*/
{
rpmdbMatchIterator * prev, next;
dbiIndex dbi;
}
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag rpmtag,
- const void * keyp, size_t keylen)
+ const void * keyp, size_t keylen)
+ /*@globals rpmmiRock @*/
+ /*@modifies rpmmiRock @*/
{
rpmdbMatchIterator mi;
DBT * key;
}
if (rc) { /* error/not found */
set = dbiFreeIndexSet(set);
+ rpmmiRock = mi->mi_next;
+ mi->mi_next = NULL;
mi = _free(mi);
return NULL;
}
mi->mi_ts = NULL;
mi->mi_hdrchk = NULL;
- /*@-nullret@*/ /* FIX: mi->mi_key.data may be NULL */
- return mi;
- /*@=nullret@*/
+/*@i@*/ return mi;
}
/* XXX psm.c */