dovecot-2.0: lib-index: Added mail_cache_reset().

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 12 18:59:04 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/117053f20528
changeset: 11988:117053f20528
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 12 16:53:04 2010 +0100
description:
lib-index: Added mail_cache_reset().

diffstat:

 src/lib-index/mail-cache.c |  12 ++++++++----
 src/lib-index/mail-cache.h |   2 ++
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 651e51de34b7 -r 117053f20528 src/lib-index/mail-cache.c
--- a/src/lib-index/mail-cache.c	Thu Aug 12 16:29:41 2010 +0100
+++ b/src/lib-index/mail-cache.c	Thu Aug 12 16:53:04 2010 +0100
@@ -25,14 +25,18 @@
 		(void)unlink(cache->filepath);
 }
 
+void mail_cache_reset(struct mail_cache *cache)
+{
+	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_unlink(cache);
-
-	/* mark the cache as unusable */
-	cache->hdr = NULL;
+	mail_cache_reset(cache);
 
 	va_start(va, fmt);
 	T_BEGIN {
diff -r 651e51de34b7 -r 117053f20528 src/lib-index/mail-cache.h
--- a/src/lib-index/mail-cache.h	Thu Aug 12 16:29:41 2010 +0100
+++ b/src/lib-index/mail-cache.h	Thu Aug 12 16:53:04 2010 +0100
@@ -112,5 +112,7 @@
 /* "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


More information about the dovecot-cvs mailing list