From: Timo Sirainen Date: Tue, 17 Jun 2008 01:51:40 +0000 (+0300) Subject: Make sure initial_modseq is correct when rotating transaction log. X-Git-Tag: 1.2.alpha1~319 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e64d7b6f388fecd0c83a4f2acb54e30d5ac98c6c;p=thirdparty%2Fdovecot%2Fcore.git Make sure initial_modseq is correct when rotating transaction log. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 582fd80a4d..039679d2e1 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -185,9 +185,15 @@ mail_transaction_log_init_hdr(struct mail_transaction_log *log, hdr->file_seq = 1; } - if (log->head != NULL && hdr->file_seq <= log->head->hdr.file_seq) { - /* make sure the sequence grows */ - hdr->file_seq = log->head->hdr.file_seq+1; + if (log->head != NULL) { + if (hdr->file_seq <= log->head->hdr.file_seq) { + /* make sure the sequence grows */ + hdr->file_seq = log->head->hdr.file_seq+1; + } + if (hdr->initial_modseq < log->head->sync_highest_modseq) { + /* this should be always up-to-date */ + hdr->initial_modseq = log->head->sync_highest_modseq; + } } return 0; }