Mercurial > dovecot > core-2.2
diff src/lib-index/mail-cache-private.h @ 3627:c0e35566dd14 HEAD
Unlocking cache file can also corrupt it since it modifies it. Added a
return value for it and checks to handle the failure. Fixes a crash in some
error situations.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 30 Sep 2005 21:46:30 +0300 |
parents | 9e2abc4c341c |
children | 61f0e1fe9b55 |
line wrap: on
line diff
--- a/src/lib-index/mail-cache-private.h Fri Sep 30 21:25:30 2005 +0300 +++ b/src/lib-index/mail-cache-private.h Fri Sep 30 21:46:30 2005 +0300 @@ -175,7 +175,8 @@ /* Explicitly lock the cache file. Returns -1 if error, 1 if ok, 0 if we couldn't lock */ int mail_cache_lock(struct mail_cache *cache); -void mail_cache_unlock(struct mail_cache *cache); +/* Returns -1 if cache is / just got corrupted, 0 if ok. */ +int mail_cache_unlock(struct mail_cache *cache); int mail_cache_write(struct mail_cache *cache, const void *data, size_t size, uoff_t offset);