diff src/lib-storage/index/dbox-single/sdbox-storage.c @ 10652:bdb1ea37ccee HEAD

dbox: Moved more mailbox creation code to dbox-common.
author Timo Sirainen <tss@iki.fi>
date Sat, 06 Feb 2010 23:41:33 +0200
parents 615eef3139c2
children 9d3b5cbef222
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-single/sdbox-storage.c	Sat Feb 06 23:22:15 2010 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-storage.c	Sat Feb 06 23:41:33 2010 +0200
@@ -183,29 +183,12 @@
 					const struct mailbox_update *update)
 {
 	struct sdbox_mailbox *mbox = (struct sdbox_mailbox *)box;
-	const char *origin;
-	mode_t mode;
-	gid_t gid;
 	int ret;
 
-	mailbox_list_get_dir_permissions(box->list, NULL, &mode, &gid, &origin);
-	if (mkdir_parents_chgrp(box->path, mode, gid, origin) == 0) {
-		/* create indexes immediately with the dbox header */
-		if (index_storage_mailbox_open(box) < 0)
-			return -1;
-		mbox->creating = TRUE;
-		ret = sdbox_write_index_header(box, update);
-		mbox->creating = FALSE;
-		if (ret < 0)
-			return -1;
-	} else if (errno != EEXIST) {
-		if (!mail_storage_set_error_from_errno(box->storage)) {
-			mail_storage_set_critical(box->storage,
-				"mkdir(%s) failed: %m", box->path);
-		}
-		return -1;
-	}
-	return 0;
+	mbox->creating = TRUE;
+	ret = sdbox_write_index_header(box, update);
+	mbox->creating = FALSE;
+	return ret;
 }
 
 static void sdbox_storage_get_status_guid(struct mailbox *box,