From: Marco Bettini Date: Tue, 28 Feb 2023 11:45:43 +0000 (+0000) Subject: dbox: dbox_cleanup_temp_files() - Reformat code X-Git-Tag: 2.4.0~2935 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e6df5633cbbf32ce195f1cef3fcb67398d8ff50;p=thirdparty%2Fdovecot%2Fcore.git dbox: dbox_cleanup_temp_files() - Reformat code --- diff --git a/src/lib-storage/index/dbox-common/dbox-storage.c b/src/lib-storage/index/dbox-common/dbox-storage.c index 498c2cee75..ae0e2e3cde 100644 --- a/src/lib-storage/index/dbox-common/dbox-storage.c +++ b/src/lib-storage/index/dbox-common/dbox-storage.c @@ -194,7 +194,6 @@ dbox_cleanup_temp_files(struct mailbox *box, const char *path, if (last_change_time == (time_t)-1) { /* Don't know the ctime yet - look it up. */ struct stat st; - if (stat(path, &st) < 0) { if (errno != ENOENT) e_error(box->event, @@ -204,6 +203,7 @@ dbox_cleanup_temp_files(struct mailbox *box, const char *path, last_change_time = st.st_ctime; stated = TRUE; } + if (last_scan_time > last_change_time + DBOX_TMP_DELETE_SECS) { /* there haven't been any changes to this directory since we last checked it. If we did an extra stat(), @@ -211,10 +211,9 @@ dbox_cleanup_temp_files(struct mailbox *box, const char *path, stat()ing the next time. */ return stated; } - const char *prefix = - mailbox_list_get_global_temp_prefix(box->list); - (void)unlink_old_files(path, prefix, - ioloop_time - DBOX_TMP_DELETE_SECS); + + const char *prefix = mailbox_list_get_global_temp_prefix(box->list); + (void)unlink_old_files(path, prefix, ioloop_time - DBOX_TMP_DELETE_SECS); return TRUE; }