From 1e6df5633cbbf32ce195f1cef3fcb67398d8ff50 Mon Sep 17 00:00:00 2001 From: Marco Bettini Date: Tue, 28 Feb 2023 11:45:43 +0000 Subject: [PATCH] dbox: dbox_cleanup_temp_files() - Reformat code --- src/lib-storage/index/dbox-common/dbox-storage.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } -- 2.47.3