[dovecot-cvs] dovecot/src/lib-storage/index/dbox dbox-storage.c, 1.53, 1.54
tss at dovecot.org
tss at dovecot.org
Sun May 13 21:28:44 EEST 2007
Update of /var/lib/cvs/dovecot/src/lib-storage/index/dbox
In directory talvi:/tmp/cvs-serv25029/lib-storage/index/dbox
Modified Files:
dbox-storage.c
Log Message:
Moved index directory creation code to index_storage_alloc().
Index: dbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-storage.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- dbox-storage.c 13 May 2007 17:10:51 -0000 1.53
+++ dbox-storage.c 13 May 2007 18:28:42 -0000 1.54
@@ -267,25 +267,6 @@
return 0;
}
-static int create_index_dir(struct mail_storage *storage, const char *name)
-{
- const char *root_dir, *index_dir;
-
- root_dir = mailbox_list_get_path(storage->list, name,
- MAILBOX_LIST_PATH_TYPE_MAILBOX);
- index_dir = mailbox_list_get_path(storage->list, name,
- MAILBOX_LIST_PATH_TYPE_INDEX);
- if (strcmp(index_dir, root_dir) == 0)
- return 0;
-
- if (mkdir_parents(index_dir, CREATE_MODE) < 0 && errno != EEXIST) {
- mail_storage_set_critical(storage, "mkdir(%s) failed: %m",
- index_dir);
- return -1;
- }
-
- return 0;
-}
static void dbox_lock_touch_timeout(struct dbox_mailbox *mbox)
{
@@ -299,20 +280,15 @@
struct mail_storage *_storage = &storage->storage;
struct dbox_mailbox *mbox;
struct mail_index *index;
- const char *path, *index_dir, *value;
+ const char *path, *value;
pool_t pool;
path = mailbox_list_get_path(_storage->list, name,
MAILBOX_LIST_PATH_TYPE_MAILBOX);
- index_dir = mailbox_list_get_path(_storage->list, name,
- MAILBOX_LIST_PATH_TYPE_INDEX);
-
if (create_dbox(_storage, path) < 0)
return NULL;
- if (create_index_dir(_storage, name) < 0)
- return NULL;
- index = index_storage_alloc(index_dir, path, DBOX_INDEX_PREFIX);
+ index = index_storage_alloc(_storage, name, flags, DBOX_INDEX_PREFIX);
pool = pool_alloconly_create("dbox mailbox", 1024+512);
mbox = p_new(pool, struct dbox_mailbox, 1);
More information about the dovecot-cvs
mailing list