[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.181.2.12, 1.181.2.13

tss at dovecot.org tss at dovecot.org
Wed Mar 7 17:34:58 EET 2007


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

Modified Files:
      Tag: branch_1_0
	mbox-sync.c 
Log Message:
minor cleanups



Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.181.2.12
retrieving revision 1.181.2.13
diff -u -d -r1.181.2.12 -r1.181.2.13
--- mbox-sync.c	28 Feb 2007 19:55:27 -0000	1.181.2.12
+++ mbox-sync.c	7 Mar 2007 15:34:56 -0000	1.181.2.13
@@ -945,7 +945,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()");
@@ -1481,8 +1481,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;
 	}
 
@@ -1792,7 +1791,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;
 
@@ -1805,11 +1806,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;
 	}



More information about the dovecot-cvs mailing list