[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.105, 1.106

cras at dovecot.org cras at dovecot.org
Sat Nov 19 14:42:58 EET 2005


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

Modified Files:
	maildir-storage.c 
Log Message:
MAILBOX_OPEN_NO_INDEX_FILES flagfix.



Index: maildir-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- maildir-storage.c	30 Sep 2005 18:55:00 -0000	1.105
+++ maildir-storage.c	19 Nov 2005 12:42:56 -0000	1.106
@@ -418,11 +418,10 @@
 	control_dir = maildir_get_control_path(storage, name);
 
 	if ((flags & MAILBOX_OPEN_NO_INDEX_FILES) != 0)
-		index = mail_index_alloc(NULL, NULL);
-	else {
-		index = index_storage_alloc(index_dir, path,
-					    MAILDIR_INDEX_PREFIX);
-	}
+		index_dir = NULL;
+
+	index = index_storage_alloc(index_dir, path,
+				    MAILDIR_INDEX_PREFIX);
 
 	/* for shared mailboxes get the create mode from the
 	   permissions of dovecot-shared file. */
@@ -493,10 +492,14 @@
 	if (stat(path, &st) == 0) {
 		/* exists - make sure the required directories are also there */
 		if (create_maildir(istorage, path, TRUE) < 0 ||
-		    create_index_dir(istorage, name) < 0 ||
 		    create_control_dir(storage, name) < 0)
 			return NULL;
 
+		if ((flags & MAILBOX_OPEN_NO_INDEX_FILES) == 0) {
+			if (create_index_dir(istorage, name) < 0)
+				return NULL;
+		}
+
 		return maildir_open(storage, name, flags);
 	} else if (errno == ENOENT) {
 		mail_storage_set_error(_storage, "Mailbox doesn't exist: %s",



More information about the dovecot-cvs mailing list