From d35fee8d1e5e31614dba5e64d45ed23c7d6bfa53 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 12 Aug 2010 16:53:04 +0100 Subject: [PATCH] lib-index: Added mail_cache_reset(). --- src/lib-index/mail-cache.c | 12 ++++++++---- src/lib-index/mail-cache.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 9c8c749ff9..1605be1bc8 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -25,14 +25,18 @@ static void mail_cache_unlink(struct mail_cache *cache) (void)unlink(cache->filepath); } -void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) +void mail_cache_reset(struct mail_cache *cache) { - va_list va; - mail_cache_unlink(cache); - /* mark the cache as unusable */ cache->hdr = NULL; +} + +void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) +{ + va_list va; + + mail_cache_reset(cache); va_start(va, fmt); T_BEGIN { diff --git a/src/lib-index/mail-cache.h b/src/lib-index/mail-cache.h index 21e3303a1c..ca1b5f676b 100644 --- a/src/lib-index/mail-cache.h +++ b/src/lib-index/mail-cache.h @@ -112,5 +112,7 @@ int mail_cache_lookup_headers(struct mail_cache_view *view, string_t *dest, /* "Error in index cache file %s: ...". */ void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) ATTR_FORMAT(2, 3); +/* Delete the cache file. */ +void mail_cache_reset(struct mail_cache *cache); #endif -- 2.47.3