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
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