dovecot-2.2: dsync: If a parent \Noselect gets autocreated, don'...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 25 07:50:19 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/8575e8f01380
changeset: 17262:8575e8f01380
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Apr 25 10:49:45 2014 +0300
description:
dsync: If a parent \Noselect gets autocreated, don't fail later when trying to re-create it.

diffstat:

 src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r ddf374a36057 -r 8575e8f01380 src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c
--- a/src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c	Thu Apr 24 18:18:42 2014 +0300
+++ b/src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c	Fri Apr 25 10:49:45 2014 +0300
@@ -167,6 +167,15 @@
 		return ret;
 	case DSYNC_MAILBOX_TREE_SYNC_TYPE_CREATE_DIR:
 		ret = mailbox_create(box, NULL, TRUE);
+		if (ret < 0 &&
+		    mailbox_get_last_mail_error(box) == MAIL_ERROR_EXISTS) {
+			/* it doesn't matter if somebody else created this
+			   directory or we automatically did while creating its
+			   child mailbox. it's there now anyway and we don't
+			   gain anything by treating this failure any
+			   differently from success. */
+			ret = 0;
+		}
 		func_name = "mailbox_create";
 		break;
 	case DSYNC_MAILBOX_TREE_SYNC_TYPE_DELETE_BOX:


More information about the dovecot-cvs mailing list