]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
crashfix
authorTimo Sirainen <tss@iki.fi>
Thu, 8 Jul 2004 18:57:16 +0000 (21:57 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 8 Jul 2004 18:57:16 +0000 (21:57 +0300)
--HG--
branch : HEAD

src/lib-index/mail-index-lock.c
src/lib-index/mail-index-private.h
src/lib-index/mail-index.c

index 88399394495de0437d8472927570ec212dd03ff4..12614391f5741a747351c74d758d0841a8841fff 100644 (file)
@@ -255,7 +255,7 @@ int mail_index_lock_exclusive(struct mail_index *index,
        /* if header size is smaller than what we have, we'll have to recreate
           the index to grow it. so don't even try regular locking. */
        if (index->map->hdr != &index->map->hdr_copy &&
-           index->map->hdr->base_header_size == sizeof(*index->hdr)) {
+           index->map->base_header_size == sizeof(*index->hdr)) {
                /* wait two seconds for exclusive lock */
                ret = mail_index_lock(index, F_WRLCK, 2, TRUE, lock_id_r);
                if (ret > 0)
index 0baa38b26c94ccc39195f0bf7ce59f2bd9d65b35..cbdb340d02187f30cfe9a8f9d538bf224ebda59a 100644 (file)
@@ -51,6 +51,7 @@ struct mail_index_map {
        uoff_t log_file_offset;
 
        struct mail_index_header hdr_copy;
+       uint32_t base_header_size; /* so we don't need lock to access it */
 
        unsigned int write_to_disk:1;
 };
index 07d82aa651b98839d1bfe9caf39e25816b37b1db..59a0102cdda87a49d05a7074c18eb2d5b5409e6a 100644 (file)
@@ -402,6 +402,7 @@ int mail_index_map(struct mail_index *index, int force)
 
        map->log_file_seq = map->hdr->log_file_seq;
        map->log_file_offset = map->hdr->log_file_offset;
+       map->base_header_size = map->hdr->base_header_size;
 
        index->hdr = map->hdr;
        index->map = map;