From: Timo Sirainen Date: Wed, 30 Sep 2009 15:08:18 +0000 (-0400) Subject: Avoid assert-crashing when two processes try to create index at the same time. X-Git-Tag: 2.0.alpha1~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bda0d095e029ec72ec683b4186e04f322b4978e;p=thirdparty%2Fdovecot%2Fcore.git Avoid assert-crashing when two processes try to create index at the same time. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index.c b/src/lib-index/mail-index.c index e2313b1424..39a3d2e3bd 100644 --- a/src/lib-index/mail-index.c +++ b/src/lib-index/mail-index.c @@ -443,6 +443,11 @@ static int mail_index_open_files(struct mail_index *index, } ret = mail_transaction_log_create(index->log, FALSE); + if (index->map != NULL) { + /* log creation could have changed it if someone else + just created it. */ + index->map->hdr.indexid = index->indexid; + } index->initial_create = FALSE; created = TRUE; }