changeset 7205:a17e3d81a517 HEAD

If cache file's version/architecture/indexid changed, make sure the file gets unlinked so it gets rebuilt.
author Timo Sirainen <tss@iki.fi>
date Thu, 31 Jan 2008 21:50:03 +0200
parents c3cb23ed73d1
children 83a3239808d3
files src/lib-index/mail-cache.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache.c	Thu Jan 31 17:33:12 2008 +0200
+++ b/src/lib-index/mail-cache.c	Thu Jan 31 21:50:03 2008 +0200
@@ -200,15 +200,18 @@
 
 	if (hdr->version != MAIL_CACHE_VERSION) {
 		/* version changed - upgrade silently */
+		(void)unlink(cache->filepath);
 		return FALSE;
 	}
 	if (hdr->compat_sizeof_uoff_t != sizeof(uoff_t)) {
 		/* architecture change - handle silently(?) */
+		(void)unlink(cache->filepath);
 		return FALSE;
 	}
 
 	if (hdr->indexid != cache->index->indexid) {
 		/* index id changed - handle silently */
+		(void)unlink(cache->filepath);
 		return FALSE;
 	}
 	if (hdr->file_seq == 0) {