]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
index: don't try to unlink in-memory cache file
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 18 Jan 2017 09:46:15 +0000 (04:46 -0500)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 18 Jan 2017 09:46:15 +0000 (04:46 -0500)
Avoid these errors:

Error: unlink((in-memory index).cache) failed: No such file or directory (in mail-cache.c:29)

src/lib-index/mail-cache.c

index 5de3b502d76dbb29a69f32808f79c77c4105b45a..67b65d8722071b4739d40af3644090f0dda2a25e 100644 (file)
@@ -25,7 +25,7 @@ void mail_cache_set_syscall_error(struct mail_cache *cache,
 
 static void mail_cache_unlink(struct mail_cache *cache)
 {
-       if (!cache->index->readonly)
+       if (!cache->index->readonly && !MAIL_INDEX_IS_IN_MEMORY(cache->index))
                i_unlink(cache->filepath);
 }