[dovecot-cvs] dovecot/src/lib-index mail-index-lock.c,1.61,1.62

tss at dovecot.org tss at dovecot.org
Sun Mar 11 20:03:57 EET 2007


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv9222

Modified Files:
	mail-index-lock.c 
Log Message:
Delete copy-lock file instead of rename()ing it if we've moved to in-memory
indexes.



Index: mail-index-lock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-lock.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- mail-index-lock.c	11 Mar 2007 16:10:41 -0000	1.61
+++ mail-index-lock.c	11 Mar 2007 18:03:55 -0000	1.62
@@ -288,7 +288,13 @@
 		}
 	}
 
-	if (ret == 0) {
+	if (ret < 0 || MAIL_INDEX_IS_IN_MEMORY(index)) {
+		/* fsync() failed / we've since moved to in-memory indexes */
+		if (unlink(index->copy_lock_path) < 0) {
+			mail_index_set_error(index, "unlink(%s) failed: %m",
+					     index->copy_lock_path);
+		}
+	} else {
 		if (rename(index->copy_lock_path, index->filepath) < 0) {
 			mail_index_set_error(index, "rename(%s, %s) failed: %m",
 					     index->copy_lock_path,



More information about the dovecot-cvs mailing list