From: Marco Bettini Date: Tue, 28 Feb 2023 11:30:22 +0000 (+0000) Subject: dbox: dbox_mailbox_open() - Drop unused ctime X-Git-Tag: 2.3.21~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e91d8309f5100a7b3d8e08d36f5b06437e9b3b5d;p=thirdparty%2Fdovecot%2Fcore.git dbox: dbox_mailbox_open() - Drop unused ctime --- diff --git a/src/lib-storage/index/dbox-common/dbox-storage.c b/src/lib-storage/index/dbox-common/dbox-storage.c index 53b853be39..b987aa0b83 100644 --- a/src/lib-storage/index/dbox-common/dbox-storage.c +++ b/src/lib-storage/index/dbox-common/dbox-storage.c @@ -214,14 +214,12 @@ dbox_cleanup_temp_files(struct mailbox_list *list, const char *path, return FALSE; } -int dbox_mailbox_check_existence(struct mailbox *box, time_t *path_ctime_r) +int dbox_mailbox_check_existence(struct mailbox *box) { const char *index_path, *box_path = mailbox_get_path(box); struct stat st; int ret = -1; - *path_ctime_r = (time_t)-1; - if (box->list->set.iter_from_index_dir) { /* Just because the index directory exists, it doesn't mean that the mailbox is selectable. Check that by seeing if @@ -241,8 +239,6 @@ int dbox_mailbox_check_existence(struct mailbox *box, time_t *path_ctime_r) } if (ret < 0) { ret = stat(box_path, &st); - if (ret == 0) - *path_ctime_r = st.st_ctime; } if (ret == 0) { @@ -261,7 +257,7 @@ int dbox_mailbox_check_existence(struct mailbox *box, time_t *path_ctime_r) } } -int dbox_mailbox_open(struct mailbox *box, time_t path_ctime ATTR_UNUSED) +int dbox_mailbox_open(struct mailbox *box) { if (index_storage_mailbox_open(box, FALSE) < 0) return -1; diff --git a/src/lib-storage/index/dbox-common/dbox-storage.h b/src/lib-storage/index/dbox-common/dbox-storage.h index ca8c835305..d7855fc36a 100644 --- a/src/lib-storage/index/dbox-common/dbox-storage.h +++ b/src/lib-storage/index/dbox-common/dbox-storage.h @@ -72,8 +72,8 @@ int dbox_storage_create(struct mail_storage *storage, void dbox_storage_destroy(struct mail_storage *storage); uint32_t dbox_get_uidvalidity_next(struct mailbox_list *list); void dbox_notify_changes(struct mailbox *box); -int dbox_mailbox_check_existence(struct mailbox *box, time_t *path_ctime_r); -int dbox_mailbox_open(struct mailbox *box, time_t path_ctime); +int dbox_mailbox_check_existence(struct mailbox *box); +int dbox_mailbox_open(struct mailbox *box); void dbox_mailbox_close(struct mailbox *box); int dbox_mailbox_create(struct mailbox *box, const struct mailbox_update *update, bool directory); diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index 8148f72c87..d1f2d156f5 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -174,11 +174,10 @@ mdbox_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list, int mdbox_mailbox_open(struct mailbox *box) { struct mdbox_mailbox *mbox = MDBOX_MAILBOX(box); - time_t path_ctime; - if (dbox_mailbox_check_existence(box, &path_ctime) < 0) + if (dbox_mailbox_check_existence(box) < 0) return -1; - if (dbox_mailbox_open(box, path_ctime) < 0) + if (dbox_mailbox_open(box) < 0) return -1; mbox->ext_id = diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index d05343cca6..23cf6e34e0 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -335,15 +335,14 @@ static int sdbox_mailbox_open(struct mailbox *box) struct sdbox_mailbox *mbox = SDBOX_MAILBOX(box); struct sdbox_index_header hdr; bool need_resize; - time_t path_ctime; - if (dbox_mailbox_check_existence(box, &path_ctime) < 0) + if (dbox_mailbox_check_existence(box) < 0) return -1; if (sdbox_mailbox_alloc_index(mbox) < 0) return -1; - if (dbox_mailbox_open(box, path_ctime) < 0) + if (dbox_mailbox_open(box) < 0) return -1; if (box->creating) {