changeset 74:d6ab9aa7e105 HEAD

Don't fsck mbox every time it's opened.
author Timo Sirainen <tss@iki.fi>
date Wed, 28 Aug 2002 22:09:47 +0300
parents 2841fc79578f
children 7418fefb57a8
files src/lib-index/mbox/mbox-sync.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-sync.c	Wed Aug 28 22:02:03 2002 +0300
+++ b/src/lib-index/mbox/mbox-sync.c	Wed Aug 28 22:09:47 2002 +0300
@@ -126,11 +126,19 @@
 	if (index->file_sync_stamp == st.st_mtime)
 		return TRUE;
 
-	index->file_sync_stamp = st.st_mtime;
-
 	if (index->mbox_size == 0 && st.st_size != 0)
 		index->mbox_size = get_indexed_mbox_size(index);
 
+	if (index->file_sync_stamp == 0 &&
+	    index->mbox_size == (uoff_t)st.st_size) {
+		/* just opened the mailbox, and the file size is same as
+		   we expected. don't bother checking it any further. */
+		index->file_sync_stamp = st.st_mtime;
+		return TRUE;
+	}
+
+	index->file_sync_stamp = st.st_mtime;
+
 	/* file has been modified. */
 	if (index->mbox_size > (uoff_t)st.st_size) {
 		/* file was grown, hopefully just new mail */