]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: dbox_mailbox_open() - Drop unused ctime
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 28 Feb 2023 11:30:22 +0000 (11:30 +0000)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 25 Apr 2023 07:52:42 +0000 (09:52 +0200)
src/lib-storage/index/dbox-common/dbox-storage.c
src/lib-storage/index/dbox-common/dbox-storage.h
src/lib-storage/index/dbox-multi/mdbox-storage.c
src/lib-storage/index/dbox-single/sdbox-storage.c

index 53b853be3971d73420eb7e88119e8aa647d621e4..b987aa0b834033f58eebefd1f45fe6f55b293721 100644 (file)
@@ -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;
index ca8c8353058d9ffefeacd568876368bdd44965a7..d7855fc36a6be09a59b4a06242b10a63ff2a55b5 100644 (file)
@@ -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);
index 8148f72c873cacb795d458ce5aa942c3c5148519..d1f2d156f5a214c8e1a791314c5118b7e4bc7047 100644 (file)
@@ -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 =
index d05343cca65e68afa36e01b2c6ce6807df461038..23cf6e34e0bb493ad54b41f7fe5ba40470d6872c 100644 (file)
@@ -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) {