bool *unlock, struct dotlock **dotlock_r)
{
const char *temp_path;
- const void *data;
int fd, ret;
/* There are two possible locking situations here:
}
if (cache->fd != -1) {
/* make sure we have mapped it before reading. */
- if (mail_cache_map(cache, 0, 0, &data) < 0)
+ if (mail_cache_map_all(cache) < 0)
return -1;
}
if (cache->file_cache != NULL)
file_cache_set_fd(cache->file_cache, cache->fd);
- if (mail_cache_map(cache, 0, 0, &data) < 0)
+ if (mail_cache_map_all(cache) < 0)
return -1;
if (mail_cache_header_fields_read(cache) < 0)
return -1;
static int mail_cache_try_open(struct mail_cache *cache)
{
- const void *data;
-
i_assert(!cache->opened);
cache->opened = TRUE;
mail_cache_init_file_cache(cache);
- if (mail_cache_map(cache, 0, 0, &data) < 0) {
+ if (mail_cache_map_all(cache) < 0) {
mail_cache_file_close(cache);
return -1;
}
static int
mail_cache_lock_full(struct mail_cache *cache, bool nonblock)
{
- const void *data;
int ret;
i_assert(!cache->locked);
}
if (cache->read_buf != NULL)
buffer_set_used_size(cache->read_buf, 0);
- if (mail_cache_map(cache, 0, 0, &data) <= 0) {
+ if (mail_cache_map_all(cache) < 0) {
(void)mail_cache_unlock(cache);
return -1;
}