changeset 5099:d75d8a0cb231 HEAD

crashfix
author Timo Sirainen <tss@iki.fi>
date Fri, 02 Feb 2007 16:14:51 +0200
parents 176c28ad604c
children b15c7ccb4671
files src/lib-index/mail-cache-transaction.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-transaction.c	Fri Feb 02 13:20:23 2007 +0200
+++ b/src/lib-index/mail-cache-transaction.c	Fri Feb 02 16:14:51 2007 +0200
@@ -470,8 +470,12 @@
 	}
 
 	if (ctx->cache_file_seq == 0) {
-		if ((ret = mail_cache_transaction_lock(ctx)) <= 0)
-			return ret;
+		if (!ctx->cache->opened)
+			(void)mail_cache_open_and_verify(ctx->cache);
+		if (MAIL_CACHE_IS_UNUSABLE(ctx->cache))
+			return -1;
+
+		ctx->cache_file_seq = ctx->cache->hdr->file_seq;
 	}
 
 	if (ctx->cache_file_seq != ctx->cache->hdr->file_seq) {