From: Timo Sirainen Date: Thu, 8 Jul 2004 18:57:16 +0000 (+0300) Subject: crashfix X-Git-Tag: 1.1.alpha1~3810 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2645bdd6547b87e2380f33ce78640118b9e9e68;p=thirdparty%2Fdovecot%2Fcore.git crashfix --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index-lock.c b/src/lib-index/mail-index-lock.c index 8839939449..12614391f5 100644 --- a/src/lib-index/mail-index-lock.c +++ b/src/lib-index/mail-index-lock.c @@ -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) diff --git a/src/lib-index/mail-index-private.h b/src/lib-index/mail-index-private.h index 0baa38b26c..cbdb340d02 100644 --- a/src/lib-index/mail-index-private.h +++ b/src/lib-index/mail-index-private.h @@ -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; }; diff --git a/src/lib-index/mail-index.c b/src/lib-index/mail-index.c index 07d82aa651..59a0102cdd 100644 --- a/src/lib-index/mail-index.c +++ b/src/lib-index/mail-index.c @@ -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;