[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-transaction.c, 1.14, 1.15

tss at dovecot.org tss at dovecot.org
Thu Jan 25 17:24:49 UTC 2007


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

Modified Files:
	maildir-transaction.c 
Log Message:
If save_commit_pre() fails, rollback the transaction.



Index: maildir-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-transaction.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- maildir-transaction.c	25 Nov 2006 22:17:42 -0000	1.14
+++ maildir-transaction.c	25 Jan 2007 17:24:47 -0000	1.15
@@ -27,9 +27,13 @@
 
 	save_ctx = mt->save_ctx;
 
-	if (index_transaction_finish_commit(&mt->ictx, log_file_seq_r,
-					    log_file_offset_r) < 0)
-		ret = -1;
+	if (ret == 0) {
+		if (index_transaction_finish_commit(&mt->ictx, log_file_seq_r,
+						    log_file_offset_r) < 0)
+			ret = -1;
+	} else {
+		index_transaction_finish_rollback(&mt->ictx);
+	}
 
 	/* transaction is destroyed now. */
 	mt = NULL;



More information about the dovecot-cvs mailing list