[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-lock.c, 1.10, 1.11

cras at dovecot.org cras at dovecot.org
Sat Oct 9 00:40:07 EEST 2004


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

Modified Files:
	mbox-lock.c 
Log Message:
Don't close mbox file stream unless we're actually using mmap. Avoids extra
read()s.



Index: mbox-lock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-lock.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mbox-lock.c	15 Aug 2004 03:40:32 -0000	1.10
+++ mbox-lock.c	8 Oct 2004 21:40:05 -0000	1.11
@@ -517,8 +517,10 @@
 	if (mbox_lock_list(ctx, F_UNLCK, 0, 0) < 0)
 		ret = -1;
 
-	/* make sure we don't keep mmap() between locks */
-	mbox_file_close_stream(ctx->ibox);
+	if (ctx->ibox->mail_read_mmaped) {
+		/* make sure we don't keep mmap() between locks */
+		mbox_file_close_stream(ctx->ibox);
+	}
 
 	ctx->ibox->mbox_lock_id += 2;
 	ctx->ibox->mbox_lock_type = F_UNLCK;



More information about the dovecot-cvs mailing list