]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Use mailbox_get_last_mail_error() for mailbox_get_path_to() errors
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 27 Oct 2020 13:08:15 +0000 (15:08 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 10 Nov 2020 15:24:01 +0000 (17:24 +0200)
mailbox_list_get_last_error() happens to work currently, but it's
accidental.

src/lib-storage/index/index-storage.c

index f5b2b99a19d831832cea2bf47b7ed7e200ef7418..a3d023724833dbb38d30aea47636a1d5301236bd 100644 (file)
@@ -180,15 +180,13 @@ int index_storage_mailbox_exists_full(struct mailbox *box, const char *subdir,
                                      enum mailbox_existence *existence_r)
 {
        struct stat st;
-       enum mail_error error;
        const char *path, *path2, *index_path;
        int ret;
 
        /* see if it's selectable */
        ret = mailbox_get_path_to(box, MAILBOX_LIST_PATH_TYPE_MAILBOX, &path);
        if (ret < 0) {
-               mailbox_list_get_last_error(box->list, &error);
-               if (error != MAIL_ERROR_NOTFOUND)
+               if (mailbox_get_last_mail_error(box) != MAIL_ERROR_NOTFOUND)
                        return -1;
                *existence_r = MAILBOX_EXISTENCE_NONE;
                return 0;