mail-cache.c revision dbd9604da561399cc6255289d5b6f6f662ab2d00
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield/* Copyright (C) 2003-2004 Timo Sirainen */
66188b02b8009075a2e0e2b89a14688c50565bf4Evgeni Golovvoid mail_cache_set_syscall_error(struct mail_cache *cache,
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov "%s failed with index cache file %s: %m",
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golovvoid mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...)
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov /* mark the cache as unusable */
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov mail_index_set_error(cache->index, "Corrupted index cache file %s: %s",
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield cache->filepath, t_strdup_vprintf(fmt, va));
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfieldvoid mail_cache_file_close(struct mail_cache *cache)
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield if (munmap(cache->mmap_base, cache->mmap_length) < 0)
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield mail_cache_set_syscall_error(cache, "munmap()");
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield file_cache_set_fd(cache->file_cache, -1);
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield mail_cache_set_syscall_error(cache, "close()");
return FALSE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
if (size == 0)
if (ret < 0) {
return cache;
return cache;
return cache;
int i, ret;
return ret;
if (ret <= 0)
ret = 0;
if (ret > 0) {
sizeof(struct mail_cache_header));
return ret;
unsigned int cont_percentage;
struct mail_cache_view *
return view;