diff src/lib-index/mail-cache-compress.c @ 6829:dbab5e592577 HEAD

NFS cache flushing APIs changed and backend implements it a bit differently. Hopefully this works now more correctly.
author Timo Sirainen <tss@iki.fi>
date Sun, 18 Nov 2007 08:40:59 +0200
parents ee1c4c3d5e5a
children af74d2e6f3c5
line wrap: on
line diff
--- a/src/lib-index/mail-cache-compress.c	Sun Nov 18 08:01:54 2007 +0200
+++ b/src/lib-index/mail-cache-compress.c	Sun Nov 18 08:40:59 2007 +0200
@@ -354,9 +354,6 @@
 	unsigned int i, count;
 	int fd, ret;
 
-	if (!MAIL_CACHE_IS_UNUSABLE(cache))
-		mail_cache_flush_read_cache(cache, TRUE);
-
 	/* get the latest info on fields */
 	if (mail_cache_header_fields_read(cache) < 0)
 		return -1;
@@ -460,6 +457,11 @@
 	if (cache->index->lock_method == FILE_LOCK_METHOD_DOTLOCK) {
 		/* we're using dotlocking, cache file creation itself creates
 		   the dotlock file we need. */
+		if (!MAIL_CACHE_IS_UNUSABLE(cache)) {
+			mail_index_flush_read_cache(cache->index,
+						    cache->filepath, cache->fd,
+						    FALSE);
+		}
 		return mail_cache_compress_locked(cache, trans, &unlock);
 	}