changeset 3712:8a613c365447 HEAD

Don't create index directory if we're not using index files
author Timo Sirainen <tss@iki.fi>
date Sat, 19 Nov 2005 14:42:43 +0200
parents 8f38c99146fc
children 123d9ec53bb7
files src/lib-storage/index/mbox/mbox-storage.c
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-storage.c	Sat Nov 19 14:35:50 2005 +0200
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Sat Nov 19 14:42:43 2005 +0200
@@ -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);
 	}