]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Don't log error on dovecot.index.cache delete if it doesn't exist
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 26 Jan 2017 07:55:22 +0000 (09:55 +0200)
committerGitLab <gitlab@git.dovecot.net>
Thu, 26 Jan 2017 19:16:56 +0000 (21:16 +0200)
For example if a cache is marked as corrupted and there is no cache, it's
not really an error that it doesn't exist.

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

src/lib-index/mail-cache.c

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