[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.220,1.221

cras at dovecot.org cras at dovecot.org
Thu Jan 19 01:14:45 EET 2006


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

Modified Files:
	mail-index.c 
Log Message:
Added mbox_min_index_size setting.



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -d -r1.220 -r1.221
--- mail-index.c	18 Jan 2006 23:04:15 -0000	1.220
+++ mail-index.c	18 Jan 2006 23:14:43 -0000	1.221
@@ -1393,7 +1393,8 @@
 		hdr = *index->hdr;
 	else if (ret == 0) {
 		/* doesn't exist, or corrupted */
-		if ((flags & MAIL_INDEX_OPEN_FLAG_CREATE) == 0)
+		if ((flags & MAIL_INDEX_OPEN_FLAG_CREATE) == 0 &&
+		    !MAIL_INDEX_IS_IN_MEMORY(index))
 			return 0;
 		mail_index_header_init(&hdr);
 		index->hdr = &hdr;
@@ -1701,6 +1702,13 @@
 	/* set the index as being into memory */
 	i_free_and_null(index->dir);
 
+	if (index->map == NULL) {
+		/* mbox file was never even opened. just mark it as being in
+		   memory and let the caller re-open the index. */
+		i_assert(index->fd == -1);
+		return -1;
+	}
+
 	/* move index map to memory */
 	map = mail_index_map_clone(index->map, index->map->hdr.record_size);
 	mail_index_unmap(index, &index->map);



More information about the dovecot-cvs mailing list