dovecot: Handle opening corrupted index files better.

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 27 18:28:56 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/8d9a156ec94e
changeset: 6322:8d9a156ec94e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 27 18:28:06 2007 +0300
description:
Handle opening corrupted index files better.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/lib-index/mail-index.c |    5 ++++-

diffs (15 lines):

diff -r 840bd34df909 -r 8d9a156ec94e src/lib-index/mail-index.c
--- a/src/lib-index/mail-index.c	Mon Aug 27 18:03:50 2007 +0300
+++ b/src/lib-index/mail-index.c	Mon Aug 27 18:28:06 2007 +0300
@@ -426,7 +426,10 @@ static bool mail_index_open_files(struct
 		ret = index->map != NULL ? 0 : mail_index_try_open(index);
 		if (ret == 0) {
 			/* doesn't exist / corrupted */
-			index->map = mail_index_map_alloc(index);
+			mail_transaction_log_close(index->log);
+			ret = mail_transaction_log_create(index->log);
+			if (ret == 0)
+				index->map = mail_index_map_alloc(index);
 		}
 	}
 	if (ret < 0) {


More information about the dovecot-cvs mailing list