[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.174,1.175

cras at dovecot.org cras at dovecot.org
Fri Dec 3 06:58:39 EET 2004


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

Modified Files:
	mail-index.c 
Log Message:
Make sure index is reopened if it's marked corrupted.



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -d -r1.174 -r1.175
--- mail-index.c	30 Nov 2004 08:59:26 -0000	1.174
+++ mail-index.c	3 Dec 2004 04:58:37 -0000	1.175
@@ -1112,8 +1112,15 @@
 {
 	int i = 0, ret;
 
-	if (index->opened)
-		return 0;
+	if (index->opened) {
+		if (index->hdr != NULL &&
+		    (index->hdr->flags & MAIL_INDEX_HDR_FLAG_CORRUPTED) != 0) {
+			/* corrupted, reopen files */
+                        mail_index_close(index);
+		} else {
+			return 0;
+		}
+	}
 
 	index->filepath = i_strconcat(index->dir, "/", index->prefix, NULL);
 



More information about the dovecot-cvs mailing list