CVS patchset: 186
CVS date: 1996/01/09 21:50:43
#include <db.h>
+#include <errno.h>
#include <stdlib.h>
#include <strings.h>
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;
}