From: Timo Sirainen Date: Thu, 30 Sep 2010 15:05:57 +0000 (+0100) Subject: lib-index: If mail_index_sync_begin() fails, don't assert-crash X-Git-Tag: 2.0.5~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8e2c73d814046705fc11cb8ee9bb6ac9ea7bf30;p=thirdparty%2Fdovecot%2Fcore.git lib-index: If mail_index_sync_begin() fails, don't assert-crash --- diff --git a/src/lib-index/mail-index-sync.c b/src/lib-index/mail-index-sync.c index c8939f38b2..6eafe5fc1b 100644 --- a/src/lib-index/mail-index-sync.c +++ b/src/lib-index/mail-index-sync.c @@ -456,6 +456,9 @@ int mail_index_sync_begin_to(struct mail_index *index, MAIL_INDEX_TRANSACTION_FLAG_EXTERNAL); mail_index_view_close(&sync_view); + /* set before any rollbacks are called */ + index->syncing = TRUE; + /* we wish to see all the changes from last mailbox sync position to the end of the transaction log */ if (mail_index_sync_set_log_view(ctx->view, hdr->log_file_seq, @@ -488,8 +491,6 @@ int mail_index_sync_begin_to(struct mail_index *index, ctx->ext_trans = mail_index_transaction_begin(ctx->view, trans_flags); ctx->ext_trans->sync_transaction = TRUE; - index->syncing = TRUE; - *ctx_r = ctx; *view_r = ctx->view; *trans_r = ctx->ext_trans;