From: Timo Sirainen Date: Tue, 27 Oct 2020 13:08:15 +0000 (+0200) Subject: lib-storage: Use mailbox_get_last_mail_error() for mailbox_get_path_to() errors X-Git-Tag: 2.3.13~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fdf93eded561516e09045f7503e82513b0d21aaf;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Use mailbox_get_last_mail_error() for mailbox_get_path_to() errors mailbox_list_get_last_error() happens to work currently, but it's accidental. --- diff --git a/src/lib-storage/index/index-storage.c b/src/lib-storage/index/index-storage.c index f5b2b99a19..a3d0237248 100644 --- a/src/lib-storage/index/index-storage.c +++ b/src/lib-storage/index/index-storage.c @@ -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;