changeset 6733:72dad50b1c9f HEAD

Crashfix if cache file got unusable in the middle of a transaction.
author Timo Sirainen <tss@iki.fi>
date Thu, 08 Nov 2007 05:56:50 +0200
parents f4b266590003
children da69c4853e35
files src/lib-index/mail-cache-transaction.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-transaction.c	Thu Nov 08 04:10:30 2007 +0200
+++ b/src/lib-index/mail-cache-transaction.c	Thu Nov 08 05:56:50 2007 +0200
@@ -828,7 +828,8 @@
 		mail_cache_transaction_open_if_needed(ctx);
 		if (!MAIL_CACHE_IS_UNUSABLE(ctx->cache))
 			ctx->cache_file_seq = ctx->cache->hdr->file_seq;
-	} else if (ctx->cache_file_seq != ctx->cache->hdr->file_seq) {
+	} else if (!MAIL_CACHE_IS_UNUSABLE(ctx->cache) &&
+		   ctx->cache_file_seq != ctx->cache->hdr->file_seq) {
 		/* cache was compressed within this transaction */
 		mail_cache_transaction_reset(ctx);
 	}