From: Timo Sirainen Date: Wed, 16 Jun 2004 02:12:00 +0000 (+0300) Subject: crashfix in error case X-Git-Tag: 1.1.alpha1~3964 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d17a90f5ae38edc8c0e6bf42c2162c9c18edb891;p=thirdparty%2Fdovecot%2Fcore.git crashfix in error case --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index 94e1e1eb87..51f8ce1a9c 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -67,7 +67,7 @@ static int mbox_sync_lock(struct mbox_sync_context *sync_ctx, int lock_type) { struct index_mailbox *ibox = sync_ctx->ibox; struct stat old_st, st; - uoff_t old_from_offset, old_offset = 0; + uoff_t old_from_offset = 0, old_offset = 0; if (sync_ctx->lock_id != 0) { if (fstat(sync_ctx->fd, &old_st) < 0) { @@ -939,12 +939,12 @@ static int mbox_sync_update_imap_base(struct mbox_sync_context *sync_ctx) { struct mbox_sync_mail_context mail_ctx; - if (mbox_sync_check_excl_lock(sync_ctx) == -1) - return -1; - sync_ctx->t = mail_index_transaction_begin(sync_ctx->sync_view, FALSE); sync_ctx->update_base_uid_last = sync_ctx->next_uid-1; + if (mbox_sync_check_excl_lock(sync_ctx) == -1) + return -1; + mbox_sync_restart(sync_ctx); if (mbox_sync_loop(sync_ctx, &mail_ctx, 1) < 0) return -1;