[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.115, 1.116

tss-movial at dovecot.org tss-movial at dovecot.org
Wed May 31 16:17:51 EEST 2006


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

Modified Files:
	maildir-storage.c 
Log Message:
Close index files before trying to unlink the index directory



Index: maildir-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- maildir-storage.c	14 Apr 2006 12:30:23 -0000	1.115
+++ maildir-storage.c	31 May 2006 13:17:49 -0000	1.116
@@ -641,14 +641,16 @@
 		return -1;
 	}
 
+	/* Make sure the indexes are closed before trying to delete the
+	   directory that contains them. It can still fail with some NFS
+	   implementations if indexes are opened by another session, but
+	   can't really help that. */
+	index_storage_destroy_unrefed();
+
 	if (storage->index_dir != NULL && *name != '/' && *name != '~' &&
 	    strcmp(storage->index_dir, storage->dir) != 0) {
 		index_dir = t_strconcat(storage->index_dir,
 					"/"MAILDIR_FS_SEP_S, name, NULL);
-		index_storage_destroy_unrefed();
-
-		/* it can fail with some NFS implementations if indexes are
-		   opened by another session.. can't really help it. */
 		if (unlink_directory(index_dir, TRUE) < 0 &&
 		    errno != ENOTEMPTY) {
 			mail_storage_set_critical(_storage,



More information about the dovecot-cvs mailing list