changeset 2296:e504e7d19bf7 HEAD

crashfix
author Timo Sirainen <tss@iki.fi>
date Thu, 08 Jul 2004 21:57:16 +0300
parents 545c1d3ead54
children 59062bb4eaac
files src/lib-index/mail-index-lock.c src/lib-index/mail-index-private.h src/lib-index/mail-index.c
diffstat 3 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-lock.c	Wed Jul 07 16:36:29 2004 +0300
+++ b/src/lib-index/mail-index-lock.c	Thu Jul 08 21:57:16 2004 +0300
@@ -255,7 +255,7 @@
 	/* 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)
--- a/src/lib-index/mail-index-private.h	Wed Jul 07 16:36:29 2004 +0300
+++ b/src/lib-index/mail-index-private.h	Thu Jul 08 21:57:16 2004 +0300
@@ -51,6 +51,7 @@
 	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;
 };
--- a/src/lib-index/mail-index.c	Wed Jul 07 16:36:29 2004 +0300
+++ b/src/lib-index/mail-index.c	Thu Jul 08 21:57:16 2004 +0300
@@ -402,6 +402,7 @@
 
 	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;