dovecot: FIXME removal

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 28 01:52:05 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/b564f45c4d7b
changeset: 5821:b564f45c4d7b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 28 01:51:59 2007 +0300
description:
FIXME removal

diffstat:

1 file changed, 13 insertions(+), 9 deletions(-)
src/lib-index/mail-index-sync.c |   22 +++++++++++++---------

diffs (40 lines):

diff -r e59892590a02 -r b564f45c4d7b src/lib-index/mail-index-sync.c
--- a/src/lib-index/mail-index-sync.c	Thu Jun 28 01:48:59 2007 +0300
+++ b/src/lib-index/mail-index-sync.c	Thu Jun 28 01:51:59 2007 +0300
@@ -350,11 +350,18 @@ int mail_index_sync_begin(struct mail_in
 	   We'll update the view to contain everything that exist in the
 	   transaction log except for expunges. They're synced in
 	   mail_index_sync_commit(). */
-	if (mail_index_map(index, MAIL_INDEX_SYNC_HANDLER_HEAD,
-			   &lock_id) <= 0) {
-		// FIXME: handle ret=0 specially?
-		mail_transaction_log_sync_unlock(index->log);
-		return -1;
+	if ((ret = mail_index_map(index, MAIL_INDEX_SYNC_HANDLER_HEAD,
+				  &lock_id)) <= 0) {
+		if (ret == 0 || mail_index_fsck(index) <= 0) {
+			mail_transaction_log_sync_unlock(index->log);
+			return -1;
+		}
+		/* let's try again */
+		if (mail_index_map(index, MAIL_INDEX_SYNC_HANDLER_HEAD,
+				   &lock_id) <= 0) {
+			mail_transaction_log_sync_unlock(index->log);
+			return -1;
+		}
 	}
 	hdr = &index->map->hdr;
 
@@ -623,11 +630,8 @@ int mail_index_sync_commit(struct mail_i
 	   and the synced expunges. sync using file handler here so that the
 	   expunge handlers get called. */
 	if (mail_index_map(ctx->index, MAIL_INDEX_SYNC_HANDLER_FILE,
-			   &lock_id) <= 0) {
-		// FIXME: handle ret=0 specially?
-		// FIXME: do we really need to return failure?
+			   &lock_id) <= 0)
 		ret = -1;
-	}
 
 	/* FIXME: create a better rule? */
 	want_rotate = mail_transaction_log_want_rotate(index->log);


More information about the dovecot-cvs mailing list