[dovecot-cvs] dovecot/src/lib-index mail-cache.c,1.3,1.4 mail-index-open.c,1.44,1.45

cras at procontrol.fi cras at procontrol.fi
Mon Aug 11 18:28:30 EEST 2003


Update of /home/cvs/dovecot/src/lib-index
In directory danu:/tmp/cvs-serv10247/lib-index

Modified Files:
	mail-cache.c mail-index-open.c 
Log Message:
some opening fixes



Index: mail-cache.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mail-cache.c	11 Aug 2003 01:56:37 -0000	1.3
+++ mail-cache.c	11 Aug 2003 14:28:27 -0000	1.4
@@ -199,7 +199,10 @@
 {
 	int fd;
 
-	i_assert(!cache->anon_mmap);
+	if (cache->anon_mmap) {
+		/* cache was set corrupted, we'll have to quit */
+		return FALSE;
+	}
 
 	fd = open(cache->filepath, O_RDWR);
 	if (fd == -1)

Index: mail-index-open.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-open.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- mail-index-open.c	11 Aug 2003 02:40:40 -0000	1.44
+++ mail-index-open.c	11 Aug 2003 14:28:27 -0000	1.45
@@ -297,9 +297,11 @@
 
 	if ((ret = mail_index_read_header(index, &hdr)) < 0)
 		return FALSE;
+	index->indexid = hdr.indexid;
 
 	if (ret == 0 || hdr.major_version != MAIL_INDEX_MAJOR_VERSION ||
-	    (hdr.flags & MAIL_INDEX_HDR_FLAG_REBUILD) != 0) {
+	    (hdr.flags & MAIL_INDEX_HDR_FLAG_REBUILD) != 0 ||
+	    !mail_index_mmap_update(index)) {
 		if ((flags & MAIL_INDEX_OPEN_FLAG_CREATE) == 0)
 			return FALSE;
 
@@ -317,11 +319,6 @@
 		if (!mail_index_init_file(index, &hdr))
 			return FALSE;
 	}
-
-	index->indexid = hdr.indexid;
-
-	if (!mail_index_mmap_update(index))
-		return FALSE;
 
 	if (index->lock_type == MAIL_LOCK_SHARED) {
 		/* we don't want to keep the shared lock while opening



More information about the dovecot-cvs mailing list