changeset 301:1d4d92c2e8c9 HEAD

fsck() before checking the rewrite-flag, so we won't write the 1-byte files..
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Sep 2002 19:41:09 +0300
parents a101127403a7
children 20769b7516a2
files src/lib-index/mbox/mbox-rewrite.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-rewrite.c	Mon Sep 23 14:48:29 2002 +0300
+++ b/src/lib-index/mbox/mbox-rewrite.c	Mon Sep 23 19:41:09 2002 +0300
@@ -277,14 +277,14 @@
 
 	i_assert(index->lock_type == MAIL_LOCK_EXCLUSIVE);
 
+	if (!mbox_index_fsck(index))
+		return FALSE;
+
 	if ((index->header->flags & MAIL_INDEX_FLAG_DIRTY_MESSAGES) == 0) {
 		/* no need to rewrite */
 		return TRUE;
 	}
 
-	if (!mbox_index_fsck(index))
-		return FALSE;
-
 	in_fd = open(index->mbox_path, O_RDWR);
 	if (in_fd == -1)
 		return mbox_set_syscall_error(index, "open()");