[dovecot-cvs] dovecot/src/lib-index mail-index-lock.c,1.35,1.36

cras at dovecot.org cras at dovecot.org
Sun Nov 7 20:57:19 EET 2004


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv15023

Modified Files:
	mail-index-lock.c 
Log Message:
Crashfix



Index: mail-index-lock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-lock.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- mail-index-lock.c	17 Oct 2004 16:42:20 -0000	1.35
+++ mail-index-lock.c	7 Nov 2004 18:57:17 -0000	1.36
@@ -316,8 +316,9 @@
 
 	/* 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_buf->data &&
-	    index->map->base_header_size == sizeof(*index->hdr)) {
+	if ((index->map->hdr != index->map->hdr_copy_buf->data &&
+	     index->map->base_header_size == sizeof(*index->hdr)) ||
+	    index->excl_lock_count > 0) {
 		/* wait two seconds for exclusive lock */
 		ret = mail_index_lock(index, F_WRLCK, 2, TRUE, lock_id_r);
 		if (ret > 0)



More information about the dovecot-cvs mailing list