[dovecot-cvs] dovecot/src/lib-index mail-index-lock.c,1.56,1.57

tss at dovecot.org tss at dovecot.org
Sun Dec 10 12:59:17 UTC 2006


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

Modified Files:
	mail-index-lock.c 
Log Message:
Don't crash with in-memory indexes



Index: mail-index-lock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-lock.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- mail-index-lock.c	6 Dec 2006 15:08:32 -0000	1.56
+++ mail-index-lock.c	10 Dec 2006 12:59:15 -0000	1.57
@@ -371,7 +371,8 @@
 		i_assert(index->lock_type == F_WRLCK);
 		index->lock_type = F_RDLCK;
 
-		(void)file_lock_try_update(index->file_lock, F_RDLCK);
+		if (!MAIL_INDEX_IS_IN_MEMORY(index))
+			(void)file_lock_try_update(index->file_lock, F_RDLCK);
 	}
 
 	if (index->copy_lock_path != NULL) {
@@ -414,7 +415,7 @@
 		index->lock_id += 2;
 		index->lock_type = F_UNLCK;
 		if (index->lock_method != FILE_LOCK_METHOD_DOTLOCK) {
-			if (unlock)
+			if (unlock && !MAIL_INDEX_IS_IN_MEMORY(index))
 				file_unlock(&index->file_lock);
 		}
 		i_assert(index->file_lock == NULL);



More information about the dovecot-cvs mailing list