changeset 5239:18a9e82f6f48 HEAD

minor cleanups
author Timo Sirainen <tss@iki.fi>
date Wed, 07 Mar 2007 17:34:58 +0200
parents 0f1208e2df7b
children 117c9fd0b633
files src/lib-storage/index/mbox/mbox-sync.c
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync.c	Wed Mar 07 16:51:04 2007 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Wed Mar 07 17:34:58 2007 +0200
@@ -941,7 +941,7 @@
 
 	if (seq1 == 0) {
 		/* doesn't exist anymore, seek to end of file */
-		st = i_stream_stat(sync_ctx->mbox->mbox_file_stream, TRUE);
+		st = i_stream_stat(sync_ctx->file_input, TRUE);
 		if (st == NULL) {
 			mbox_set_syscall_error(sync_ctx->mbox,
 					       "i_stream_stat()");
@@ -1477,8 +1477,7 @@
 
 	st = i_stream_stat(sync_ctx->file_input, FALSE);
 	if (st == NULL) {
-		mbox_set_syscall_error(sync_ctx->mbox,
-				       "i_stream_stat()");
+		mbox_set_syscall_error(sync_ctx->mbox, "i_stream_stat()");
 		return -1;
 	}
 
@@ -1786,7 +1785,9 @@
                 ret = mbox_rewrite_base_uid_last(&sync_ctx);
 	}
 
-	if (lock_id != 0 && mbox->mbox_lock_type != F_RDLCK) {
+	i_assert(lock_id != 0);
+
+	if (mbox->mbox_lock_type != F_RDLCK) {
 		/* drop to read lock */
 		unsigned int read_lock_id = 0;
 
@@ -1799,11 +1800,7 @@
 		}
 	}
 
-	if (lock_id != 0 && (flags & MBOX_SYNC_LOCK_READING) == 0) {
-		/* FIXME: keep the lock MBOX_SYNC_SECS+1 to make sure we
-		   notice changes made by others .. and this has to be done
-		   even if lock_reading is set.. except if
-		   mbox_sync_dirty = TRUE */
+	if ((flags & MBOX_SYNC_LOCK_READING) == 0) {
 		if (mbox_unlock(mbox, lock_id) < 0)
 			ret = -1;
 	}