[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c, 1.126, 1.127

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


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

Modified Files:
	mbox-storage.c 
Log Message:
Don't create index directory if we're not using index files



Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- mbox-storage.c	19 Nov 2005 12:35:50 -0000	1.126
+++ mbox-storage.c	19 Nov 2005 12:42:43 -0000	1.127
@@ -455,10 +455,6 @@
 			"open(%s, O_CREAT) failed: %m", storage->inbox_path);
 	}
 
-	/* make sure the index directories exist */
-	if (create_mbox_index_dirs(storage, "INBOX") < 0)
-		return -1;
-
 	return 0;
 }
 
@@ -541,6 +537,12 @@
 	if ((flags & MAILBOX_OPEN_NO_INDEX_FILES) != 0)
 		index_dir = NULL;
 
+	if (index_dir != NULL) {
+		/* make sure the index directories exist */
+		if (create_mbox_index_dirs(storage, "INBOX") < 0)
+			return -1;
+	}
+
 	index = index_storage_alloc(index_dir, path, MBOX_INDEX_PREFIX);
 	mbox = mbox_alloc(storage, index, name, flags);
 	if (mbox == NULL)
@@ -630,10 +632,6 @@
 			return NULL;
 		}
 
-		/* exists - make sure the required directories are also there */
-		if (create_mbox_index_dirs(istorage, name) < 0)
-			return NULL;
-
 		return mbox_open(storage, name, flags);
 	}
 



More information about the dovecot-cvs mailing list