changeset 6158:6e9b6468398f HEAD

If index is in memory, don't try to unlink() cache file.
author Timo Sirainen <tss@iki.fi>
date Thu, 02 Aug 2007 15:56:47 +0300
parents e458f915009e
children 078d9dde99c8
files src/lib-index/mail-cache.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache.c	Thu Aug 02 15:35:27 2007 +0300
+++ b/src/lib-index/mail-cache.c	Thu Aug 02 15:56:47 2007 +0300
@@ -369,8 +369,10 @@
 	struct mail_cache *cache;
 
 	cache = mail_cache_alloc(index);
-	if (unlink(cache->filepath) < 0 && errno != ENOENT)
-		mail_cache_set_syscall_error(cache, "unlink()");
+	if (!MAIL_INDEX_IS_IN_MEMORY(index)) {
+		if (unlink(cache->filepath) < 0 && errno != ENOENT)
+			mail_cache_set_syscall_error(cache, "unlink()");
+	}
 	return cache;
 }