Fix handling of DB4 hcache open failure. (closes: #2714)
authorDaniel Burrows <dburrows@debian.org>
Sat, 31 Mar 2007 04:26:16 +0000 (21:26 -0700)
committerDaniel Burrows <dburrows@debian.org>
Sat, 31 Mar 2007 04:26:16 +0000 (21:26 -0700)
hcache.c

index b5b3d59e4279e209614ac2776273a1db1c246bbe..facf04eea47a7e8e70906f303c4a4d6f9ea2d5d9 100644 (file)
--- a/hcache.c
+++ b/hcache.c
@@ -984,17 +984,13 @@ mutt_hcache_open(const char *path, const char *folder)
 
   ret = (*h->env->open)(h->env, NULL, DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE,
        0600);
-  if (!ret)
+  if (ret)
   {
-    ret = db_create(&h->db, h->env, 0);
-    if (ret)
-    {
-      h->env->close(h->env, 0);
-      mx_unlock_file(h->lockfile, h->fd, 0);
-      close(h->fd);
-      FREE(&h);
-      return NULL;
-    }
+    h->env->close(h->env, 0);
+    mx_unlock_file(h->lockfile, h->fd, 0);
+    close(h->fd);
+    FREE(&h);
+    return NULL;
   }
 
   if (stat(path, &sb) != 0 && errno == ENOENT)