]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: If a parent \Noselect gets autocreated, don't fail later when trying to re...
authorTimo Sirainen <tss@iki.fi>
Fri, 25 Apr 2014 07:49:45 +0000 (10:49 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 25 Apr 2014 07:49:45 +0000 (10:49 +0300)
src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c

index e02ab40f748d99ea962b39c00f4492da6470dc86..2175b5a7cf09a04ac01ec44c52ef9dc621bf2582 100644 (file)
@@ -167,6 +167,15 @@ int dsync_brain_mailbox_tree_sync_change(struct dsync_brain *brain,
                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: