changeset 6761:d0a2e137f044 HEAD

Code cleanup
author Timo Sirainen <tss@iki.fi>
date Sat, 10 Nov 2007 19:54:44 +0200
parents 74f4cea90bcd
children ba74249c79f0
files src/lib-index/mail-transaction-log-file.c
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 	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;
 		}