From: Timo Sirainen Date: Sat, 19 Jun 2004 01:04:16 +0000 (+0300) Subject: assert crashfix for readonly mboxes X-Git-Tag: 1.1.alpha1~3938 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce87b6ad8740cc66c5ab232081a2b4a535ff91ae;p=thirdparty%2Fdovecot%2Fcore.git assert crashfix for readonly mboxes --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index cc92ebde0b..d1e49acb1c 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -1065,8 +1065,8 @@ int mbox_sync(struct index_mailbox *ibox, int last_commit, int lock) ret = mail_index_get_header(sync_view, &sync_ctx.hdr); i_assert(ret == 0); - lock_type = mail_index_sync_have_more(index_sync_ctx) ? - F_WRLCK : F_RDLCK; + lock_type = mail_index_sync_have_more(index_sync_ctx) && + !ibox->mbox_readonly ? F_WRLCK : F_RDLCK; if (lock_type == F_WRLCK && lock) { (void)mbox_unlock(ibox, lock_id); lock_id = 0;