# HG changeset patch # User Timo Sirainen # Date 1030561787 -10800 # Node ID d6ab9aa7e1053c97431f75dc5b5f44ab3f94b726 # Parent 2841fc79578fe3960872f590fffaf901f5baaa8b Don't fsck mbox every time it's opened. diff -r 2841fc79578f -r d6ab9aa7e105 src/lib-index/mbox/mbox-sync.c --- 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 */