[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.46, 1.47

cras at dovecot.org cras at dovecot.org
Sun Dec 5 03:45:56 EET 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv16527/lib-storage/index/maildir

Modified Files:
	maildir-sync.c 
Log Message:
Renamed mail_index_refresh() to mail_index_reopen_if_needed(). Added public
mail_index_refresh() which makes sure index is fully refreshed at the time.
Added mbox code to call it after mbox is locked to avoid using old mbox offsets.



Index: maildir-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- maildir-sync.c	24 Nov 2004 20:40:41 -0000	1.46
+++ maildir-sync.c	5 Dec 2004 01:45:54 -0000	1.47
@@ -537,15 +537,13 @@
 	ibox->last_cur_mtime = mail_index_get_header(ibox->view)->sync_stamp;
 	if (ibox->dirty_cur_time == 0 && cur_mtime != ibox->last_cur_mtime) {
 		/* check if the index has been updated.. */
-		struct mail_index_view *view;
-
-		if (mail_index_view_open_locked(ibox->index, &view) < 0) {
+		if (mail_index_refresh(ibox->index) < 0) {
 			mail_storage_set_index_error(ibox);
 			return -1;
 		}
 
-		ibox->last_cur_mtime = mail_index_get_header(view)->sync_stamp;
-		mail_index_view_close(view);
+		ibox->last_cur_mtime =
+			mail_index_get_header(ibox->view)->sync_stamp;
 	}
 
 	if (new_mtime != ibox->last_new_mtime ||



More information about the dovecot-cvs mailing list