dovecot: Code cleanup

dovecot at dovecot.org dovecot at dovecot.org
Sat Nov 10 19:54:50 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/d0a2e137f044
changeset: 6761:d0a2e137f044
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Nov 10 19:54:44 2007 +0200
description:
Code cleanup

diffstat:

1 file changed, 10 insertions(+), 13 deletions(-)
src/lib-index/mail-transaction-log-file.c |   23 ++++++++++-------------

diffs (33 lines):

diff -r 74f4cea90bcd -r d0a2e137f044 src/lib-index/mail-transaction-log-file.c
--- a/src/lib-index/mail-transaction-log-file.c	Sat Nov 10 19:39:06 2007 +0200
+++ b/src/lib-index/mail-transaction-log-file.c	Sat Nov 10 19:54:44 2007 +0200
@@ -781,19 +781,16 @@ mail_transaction_log_file_sync(struct ma
 	if (avail != size) {
 		/* There's more data than we could sync at the moment. If the
 		   last record's size wasn't valid, we can't know if it will
-		   be updated unless we've locked the log.
-
-		   If the record size was valid, this is an error because the
-		   pread()s or the above fstat() check for mmaps should have
-		   guaranteed that this doesn't happen. */
-		if (file->locked || trans_size != 0) {
-			if (trans_size != 0) {
-				mail_transaction_log_file_set_corrupted(file,
-					"hdr.size too large (%u)", trans_size);
-			} else {
-				mail_transaction_log_file_set_corrupted(file,
-					"Unexpected garbage at EOF");
-			}
+		   be updated unless we've locked the log. */
+		if (trans_size != 0) {
+			/* pread()s or the above fstat() check for mmaps should
+			   have guaranteed that this doesn't happen */
+			mail_transaction_log_file_set_corrupted(file,
+				"hdr.size too large (%u)", trans_size);
+			return -1;
+		} else if (file->locked) {
+			mail_transaction_log_file_set_corrupted(file,
+				"Unexpected garbage at EOF");
 			return -1;
 		}
 


More information about the dovecot-cvs mailing list