changeset 2746:bf2bdf2dd9ae HEAD

Log syncing fixes
author Timo Sirainen <tss@iki.fi>
date Fri, 15 Oct 2004 01:16:43 +0300
parents 2e81cd0a9acd
children 1e65e0684377
files src/lib-index/mail-transaction-log.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log.c	Fri Oct 15 00:54:47 2004 +0300
+++ b/src/lib-index/mail-transaction-log.c	Fri Oct 15 01:16:43 2004 +0300
@@ -742,10 +742,10 @@
 
 		size = read_offset - file->buffer_offset;
 		buffer_set_used_size(file->buffer, size);
+	} while (ret > 0 || (ret < 0 && errno == EINTR));
 
-		if (mail_transaction_log_file_sync(file) < 0)
-			return -1;
-	} while (ret > 0 || (ret < 0 && errno == EINTR));
+	if (mail_transaction_log_file_sync(file) < 0)
+		return -1;
 
 	if (ret == 0) {
 		/* EOF */
@@ -812,6 +812,8 @@
 	    file->buffer_offset <= start_offset) {
 		/* it's all mmaped already */
 		i_assert(end_offset == (uoff_t)-1);
+		if (mail_transaction_log_file_sync(file) < 0)
+			return -1;
 		return 1;
 	}