]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Avoid assert-crashing when two processes try to create index at the same time.
authorTimo Sirainen <tss@iki.fi>
Wed, 30 Sep 2009 15:08:18 +0000 (11:08 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 30 Sep 2009 15:08:18 +0000 (11:08 -0400)
--HG--
branch : HEAD

src/lib-index/mail-index.c

index e2313b1424224a7e6432b8f29956d70ddfd77e33..39a3d2e3bd79732edc8981b8532c619e1f274be7 100644 (file)
@@ -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;
        }