[dovecot-cvs] dovecot/src/lib-index/mbox mbox-sync.c,1.20,1.21

cras at procontrol.fi cras at procontrol.fi
Mon Nov 4 11:19:23 EET 2002


Update of /home/cvs/dovecot/src/lib-index/mbox
In directory danu:/tmp/cvs-serv24304

Modified Files:
	mbox-sync.c 
Log Message:
We did a full sync too often.



Index: mbox-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mbox/mbox-sync.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mbox-sync.c	4 Nov 2002 04:47:40 -0000	1.20
+++ mbox-sync.c	4 Nov 2002 09:19:19 -0000	1.21
@@ -38,7 +38,7 @@
 		return 0;
 	}
 
-	return offset;
+	return offset + 1; /* +1 for trailing \n */
 }
 
 static int mbox_lock_and_sync_full(MailIndex *index,
@@ -104,16 +104,18 @@
 
 		index->mbox_size = get_indexed_mbox_size(index);
 		if (index->file_sync_stamp == 0 &&
-		    index->mbox_size == filesize+1) {
+		    index->mbox_size == filesize) {
 			/* just opened the mailbox, and the file size is same
 			   as we expected. don't bother checking it any
-			   further. the +1 comes from the extra \n at end. */
+			   further. */
 		} else {
 			if (changes != NULL)
 				*changes = TRUE;
 
 			if (!mbox_lock_and_sync_full(index, data_lock_type))
 				return FALSE;
+
+			index->mbox_size = filesize;
 		}
 
 		index->file_sync_stamp = st.st_mtime;




More information about the dovecot-cvs mailing list