fix error handling in rpm_byrpmdbid
authorMichael Schroeder <mls@suse.de>
Fri, 12 Apr 2013 11:36:05 +0000 (13:36 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 12 Apr 2013 11:36:05 +0000 (13:36 +0200)
ext/repo_rpmdb.c

index 01b6cb2..20b3715 100644 (file)
@@ -2471,7 +2471,7 @@ rpm_byrpmdbid(void *rpmstate, Id rpmdbid)
   DBT dbdata;
   RpmHead *rpmhead;
 
-  if (!state->dbopened && !openpkgdb(state, state->rootdir))
+  if (state->dbopened != 1 && !openpkgdb(state, state->rootdir))
     return 0;
   rpmdbid2db(buf, rpmdbid, state->byteswapped);
   memset(&dbkey, 0, sizeof(dbkey));