changeset 241:fc8ad9d30478 HEAD

mbox fixes
author Timo Sirainen <tss@iki.fi>
date Mon, 16 Sep 2002 08:00:37 +0300
parents 5523767c0515
children 015910e16bfa
files src/lib-index/mbox/mbox-rebuild.c src/lib-index/mbox/mbox-rewrite.c
diffstat 2 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-rebuild.c	Mon Sep 16 07:28:13 2002 +0300
+++ b/src/lib-index/mbox/mbox-rebuild.c	Mon Sep 16 08:00:37 2002 +0300
@@ -38,11 +38,6 @@
 	if (msync(index->mmap_base, sizeof(MailIndexHeader), MS_SYNC) < 0)
 		return index_set_syscall_error(index, "msync()");
 
-	/* truncate the file first, so it won't contain
-	   any invalid data even if we crash */
-	if (ftruncate(index->fd, sizeof(MailIndexHeader)) < 0)
-		return index_set_syscall_error(index, "ftruncate()");
-
 	/* reset data file */
 	if (!mail_index_data_reset(index->data))
 		return FALSE;
--- a/src/lib-index/mbox/mbox-rewrite.c	Mon Sep 16 07:28:13 2002 +0300
+++ b/src/lib-index/mbox/mbox-rewrite.c	Mon Sep 16 08:00:37 2002 +0300
@@ -274,7 +274,7 @@
 
 	i_assert(index->lock_type == MAIL_LOCK_EXCLUSIVE);
 
-	if (index->header->flags & MAIL_INDEX_FLAG_DIRTY_MESSAGES) {
+	if ((index->header->flags & MAIL_INDEX_FLAG_DIRTY_MESSAGES) == 0) {
 		/* no need to rewrite */
 		return TRUE;
 	}