From: Timo Sirainen Date: Sun, 20 Jun 2004 09:40:00 +0000 (+0300) Subject: don't do infinite looping X-Git-Tag: 1.1.alpha1~3902 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d565eaa943f29a49b97230ced57eec40ee65b4f9;p=thirdparty%2Fdovecot%2Fcore.git don't do infinite looping --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 5bb06ec97b..e852abe8ae 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -246,15 +246,14 @@ int mail_cache_mmap_update(struct mail_cache *cache, size_t offset, size_t size) { int synced, ret; - for (synced = FALSE;; synced = TRUE) { - ret = mmap_update_nocheck(cache, offset, size); - if (ret > 0) - return 0; - if (ret < 0) - return -1; + ret = mmap_update_nocheck(cache, offset, size); + if (ret > 0) + return 0; + if (ret < 0) + return -1; - if (mmap_verify_header(cache) <= 0) - return -1; + if (mmap_verify_header(cache) <= 0) + return -1; #if 0 // FIXME /* see if cache file was rebuilt - do it only once to avoid @@ -266,7 +265,6 @@ int mail_cache_mmap_update(struct mail_cache *cache, size_t offset, size_t size) if (mail_cache_file_reopen(cache) < 0) return -1; #endif - } return 0; }