From 39066752e08757d65381c18b27b2df0860574472 Mon Sep 17 00:00:00 2001 From: pdmef Date: Sun, 15 May 2005 14:01:56 +0000 Subject: [PATCH] Rocco Rutte: qdbm vlopen improvement (patch again by Thomas Glanzmann) git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@292 e385b8ad-14ed-0310-8656-cc95a2468c6d --- hcache.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hcache.c b/hcache.c index c6892ff..734014d 100644 --- a/hcache.c +++ b/hcache.c @@ -617,7 +617,7 @@ void * mutt_hcache_open(const char *path, const char *folder) { struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE)); - int flags = 0; + int flags = VL_OWRITER | VL_OCREAT; #if 0 /* FIXME */ int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384; #endif @@ -635,14 +635,9 @@ mutt_hcache_open(const char *path, const char *folder) path = mutt_hcache_per_folder(path, folder); if (option(OPTHCACHECOMPRESS)) - flags = VL_OZCOMP; + flags |= VL_OZCOMP; - h->db = vlopen(path, flags | VL_OWRITER | VL_OCREAT, VL_CMPLEX); - if (h->db) - return h; - - /* if rw failed try ro */ - h->db = vlopen(path, flags | VL_OREADER, VL_CMPLEX); + h->db = vlopen(path, flags, VL_CMPLEX); if (h->db) return h; else -- 2.20.1