diff src/lib-storage/index/maildir/maildir-sync.c @ 2936:57f975a9b63b HEAD

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.
author Timo Sirainen <tss@iki.fi>
date Sun, 05 Dec 2004 03:45:53 +0200
parents fd431866c674
children 61c8d205d887
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-sync.c	Sun Dec 05 03:41:45 2004 +0200
+++ b/src/lib-storage/index/maildir/maildir-sync.c	Sun Dec 05 03:45:53 2004 +0200
@@ -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 ||