[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.115.2.1, 1.115.2.2

cras at dovecot.org cras at dovecot.org
Wed May 31 16:17:20 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	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.2.1
retrieving revision 1.115.2.2
diff -u -d -r1.115.2.1 -r1.115.2.2
--- maildir-storage.c	12 May 2006 08:12:59 -0000	1.115.2.1
+++ maildir-storage.c	31 May 2006 13:17:17 -0000	1.115.2.2
@@ -653,14 +653,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