[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.41, 1.42

cras at dovecot.org cras at dovecot.org
Sun Oct 24 03:22:13 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv23050/lib-storage/index/maildir

Modified Files:
	maildir-sync.c 
Log Message:
Don't crash to asserts



Index: maildir-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- maildir-sync.c	4 Oct 2004 16:31:51 -0000	1.41
+++ maildir-sync.c	24 Oct 2004 00:22:11 -0000	1.42
@@ -600,8 +600,12 @@
 	}
 	sync_ctx.view = view;
 
-	ret = mail_index_get_header(view, &hdr);
-	i_assert(ret == 0); /* view is locked, can't happen */
+	if (mail_index_get_header(view, &hdr) < 0) {
+		/* view is invalidated */
+		mail_storage_set_index_error(ibox);
+		(void)mail_index_sync_rollback(sync_ctx.sync_ctx);
+		return -1;
+	}
 
 	uid_validity = maildir_uidlist_get_uid_validity(ibox->uidlist);
 	if (uid_validity != hdr->uid_validity &&



More information about the dovecot-cvs mailing list