diff src/lib-storage/index/mbox/mbox-save.c @ 562:ca988d72265b HEAD

APPEND fixed for mbox
author Timo Sirainen <tss@iki.fi>
date Sun, 03 Nov 2002 01:25:40 +0200
parents 3b53dd1280c6
children b69e50478671
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-save.c	Sun Nov 03 00:51:11 2002 +0200
+++ b/src/lib-storage/index/mbox/mbox-save.c	Sun Nov 03 01:25:40 2002 +0200
@@ -182,10 +182,10 @@
 	if (!index_mailbox_fix_custom_flags(ibox, &real_flags, custom_flags))
 		return FALSE;
 
-	index = ibox->index;
-	if (!mbox_lock(index, MAIL_LOCK_EXCLUSIVE))
+	if (!index_storage_sync_and_lock(ibox, FALSE, MAIL_LOCK_EXCLUSIVE))
 		return FALSE;
 
+	index = ibox->index;
 	mbox_path = index->mbox_path;
 	if (!mbox_seek_to_end(box->storage, index->mbox_fd, mbox_path, &pos))
 		failed = TRUE;
@@ -212,6 +212,8 @@
 		t_pop();
 	}
 
-	(void)mbox_unlock(index);
+	if (!ibox->index->set_lock(ibox->index, MAIL_LOCK_UNLOCK))
+		return mail_storage_set_index_error(ibox);
+
 	return !failed;
 }