Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6449:880e1bf0127b HEAD
If we couldn't lock dovecot-uidlist, drop our appends so they don't get
written to transaction log with uid=0.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 22 Sep 2007 12:53:03 +0300 |
parents | bb838223bb93 |
children | 3132ce8f425d |
files | src/lib-storage/index/maildir/maildir-save.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-save.c Sat Sep 22 12:51:54 2007 +0300 +++ b/src/lib-storage/index/maildir/maildir-save.c Sat Sep 22 12:53:03 2007 +0300 @@ -572,7 +572,7 @@ struct maildir_transaction_context *t = (struct maildir_transaction_context *)ctx->ctx.transaction; struct maildir_filename *mf; - uint32_t first_uid, next_uid; + uint32_t seq, first_uid, next_uid; enum maildir_uidlist_rec_flag flags; const char *dest; bool newdir, sync_commit = FALSE; @@ -627,6 +627,11 @@ /* this will work even if index isn't updated */ *t->ictx.first_saved_uid = first_uid; *t->ictx.last_saved_uid = first_uid + ctx->files_count - 1; + } else { + /* since we couldn't lock uidlist, we'll have to drop the + appends to index. */ + for (seq = ctx->seq; seq >= ctx->first_seq; seq--) + mail_index_expunge(ctx->trans, seq); } /* move them into new/ and/or cur/ */