Mercurial > dovecot > core-2.2
changeset 12548:832d77536f07
lib-storage: Crashfix for opening sdbox/mdbox mailbox.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 29 Dec 2010 11:39:32 +0200 |
parents | e6a9bf26ad1e |
children | bbfa924bc4bc |
files | src/lib-storage/index/index-storage.c |
diffstat | 1 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-storage.c Mon Dec 06 04:36:30 2010 +0000 +++ b/src/lib-storage/index/index-storage.c Wed Dec 29 11:39:32 2010 +0200 @@ -162,14 +162,6 @@ if (move_to_memory) ibox->index_flags &= ~MAIL_INDEX_OPEN_FLAG_CREATE; - if ((index_flags & MAIL_INDEX_OPEN_FLAG_NEVER_IN_MEMORY) != 0) { - if (mail_index_is_in_memory(box->index)) { - mail_storage_set_critical(box->storage, - "Couldn't create index file"); - return -1; - } - } - if (mailbox_list_create_missing_index_dir(box->list, box->name) < 0) { mail_storage_set_internal_error(box->storage); return -1; @@ -201,6 +193,13 @@ i_panic("in-memory index creation failed"); } } + if ((index_flags & MAIL_INDEX_OPEN_FLAG_NEVER_IN_MEMORY) != 0) { + if (mail_index_is_in_memory(box->index)) { + mail_storage_set_critical(box->storage, + "Couldn't create index file"); + return -1; + } + } box->cache = mail_index_get_cache(box->index); index_cache_register_defaults(box);