From: ewt Date: Tue, 9 Jan 1996 21:50:43 +0000 (+0000) Subject: fixed detection of errors on open X-Git-Tag: tznext/4.11.0.1.tizen20130304~11774 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6dfde414fb1bea071b6cc0b9d8dfeaaa1a6b995;p=tools%2Flibrpm-tizen.git fixed detection of errors on open CVS patchset: 186 CVS date: 1996/01/09 21:50:43 --- diff --git a/lib/dbindex.c b/lib/dbindex.c index 367490d..28612e7 100644 --- a/lib/dbindex.c +++ b/lib/dbindex.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -11,10 +12,11 @@ dbIndex * openDBIndex(char * filename, int flags, int perms) { db = malloc(sizeof(*db)); db->indexname = strdup(filename); db->db = dbopen(filename, flags, perms, DB_HASH, NULL); - if (!db) { + if (!db->db) { free(db->indexname); free(db); - error(RPMERR_DBOPEN, "cannot open file %s filename"); + error(RPMERR_DBOPEN, "cannot open file %s: ", filename, + strerror(errno)); return NULL; }