changeset 3559:bf294d77e1ec HEAD

Try harder to notice bugs
author Timo Sirainen <tss@iki.fi>
date Sun, 28 Aug 2005 15:22:47 +0300
parents bfd47c33c46d
children 3533923e786f
files src/lib-storage/index/mbox/mbox-save.c src/lib-storage/index/mbox/mbox-sync.c
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-save.c	Sat Aug 27 17:42:38 2005 +0300
+++ b/src/lib-storage/index/mbox/mbox-save.c	Sun Aug 28 15:22:47 2005 +0300
@@ -277,6 +277,7 @@
 	if (ctx->append_offset == (uoff_t)-1) {
 		/* first appended mail in this transaction */
 		if (mbox->mbox_lock_type != F_WRLCK) {
+			i_assert(mbox->mbox_lock_type != F_WRLCK);
 			if (mbox_lock(mbox, F_WRLCK, &t->mbox_lock_id) <= 0)
 				return -1;
 		}
--- a/src/lib-storage/index/mbox/mbox-sync.c	Sat Aug 27 17:42:38 2005 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Sun Aug 28 15:22:47 2005 +0300
@@ -1686,7 +1686,7 @@
 
 	sync_ctx.file_input = sync_ctx.mbox->mbox_file_stream;
 	sync_ctx.input = sync_ctx.mbox->mbox_stream;
-	sync_ctx.write_fd = sync_ctx.mbox->mbox_readonly ? -1 :
+	sync_ctx.write_fd = sync_ctx.mbox->mbox_lock_type != F_WRLCK ? -1 :
 		sync_ctx.mbox->mbox_fd;
 
 	ret = mbox_sync_do(&sync_ctx, flags);