Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/lib-index/mail-cache.c @ 2929:ba9062032877 HEAD
Locking fixes and cleanups
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 04 Dec 2004 23:55:41 +0200 |
parents | 9b772db4503d |
children | c3ae75597952 |
comparison
equal
deleted
inserted
replaced
2928:3470bb04fb57 | 2929:ba9062032877 |
---|---|
350 /* make sure our header is up to date */ | 350 /* make sure our header is up to date */ |
351 if (cache->file_cache != NULL) { | 351 if (cache->file_cache != NULL) { |
352 file_cache_invalidate(cache->file_cache, 0, | 352 file_cache_invalidate(cache->file_cache, 0, |
353 sizeof(struct mail_cache_header)); | 353 sizeof(struct mail_cache_header)); |
354 } | 354 } |
355 if (mail_cache_map(cache, 0, 0) < 0) | 355 if (mail_cache_map(cache, 0, 0) < 0) { |
356 mail_cache_unlock(cache); | |
356 ret = -1; | 357 ret = -1; |
358 } | |
357 cache->hdr_copy = *cache->hdr; | 359 cache->hdr_copy = *cache->hdr; |
358 } | 360 } |
359 | 361 |
360 mail_index_view_close(view); | 362 mail_index_view_close(view); |
363 i_assert((ret <= 0 && !cache->locked) || (ret > 0 && cache->locked)); | |
361 return ret; | 364 return ret; |
362 } | 365 } |
363 | 366 |
364 static void mail_cache_update_need_compress(struct mail_cache *cache) | 367 static void mail_cache_update_need_compress(struct mail_cache *cache) |
365 { | 368 { |