[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.23, 1.24

cras at procontrol.fi cras at procontrol.fi
Wed Jun 16 05:12:02 EEST 2004


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

Modified Files:
	mbox-sync.c 
Log Message:
crashfix in error case



Index: mbox-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- mbox-sync.c	15 Jun 2004 02:05:55 -0000	1.23
+++ mbox-sync.c	16 Jun 2004 02:12:00 -0000	1.24
@@ -67,7 +67,7 @@
 {
 	struct index_mailbox *ibox = sync_ctx->ibox;
 	struct stat old_st, st;
-	uoff_t old_from_offset, old_offset = 0;
+	uoff_t old_from_offset = 0, old_offset = 0;
 
 	if (sync_ctx->lock_id != 0) {
 		if (fstat(sync_ctx->fd, &old_st) < 0) {
@@ -939,12 +939,12 @@
 {
 	struct mbox_sync_mail_context mail_ctx;
 
-	if (mbox_sync_check_excl_lock(sync_ctx) == -1)
-		return -1;
-
 	sync_ctx->t = mail_index_transaction_begin(sync_ctx->sync_view, FALSE);
 	sync_ctx->update_base_uid_last = sync_ctx->next_uid-1;
 
+	if (mbox_sync_check_excl_lock(sync_ctx) == -1)
+		return -1;
+
 	mbox_sync_restart(sync_ctx);
 	if (mbox_sync_loop(sync_ctx, &mail_ctx, 1) < 0)
 		return -1;



More information about the dovecot-cvs mailing list