]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: dbox_cleanup_temp_files() - Fix inverted check for ENOENT
authorMarco Bettini <marco.bettini@open-xchange.com>
Fri, 3 Mar 2023 16:15:17 +0000 (16:15 +0000)
committermarkus.valentin <markus.valentin@open-xchange.com>
Fri, 10 Mar 2023 10:51:41 +0000 (10:51 +0000)
src/lib-storage/index/dbox-common/dbox-storage.c

index a24442f5dd48da1f954fcd4b0644a25de94ef018..b3d61d77d9e50ef402bd73b5457bd3d6502350ad 100644 (file)
@@ -177,7 +177,6 @@ static bool
 dbox_cleanup_temp_files(struct mailbox *box, const char *path,
                        time_t last_scan_time, time_t last_change_time)
 {
-       struct event *event = box->event;
        unsigned int interval = box->list->mail_set->mail_temp_scan_interval;
 
        /* check once in a while if there are temp files to clean up */
@@ -194,8 +193,9 @@ dbox_cleanup_temp_files(struct mailbox *box, const char *path,
                        struct stat st;
 
                        if (stat(path, &st) < 0) {
-                               if (errno == ENOENT)
-                                       e_error(event, "stat(%s) failed: %m", path);
+                               if (errno != ENOENT)
+                                       e_error(box->event,
+                                               "stat(%s) failed: %m", path);
                                return FALSE;
                        }
                        last_change_time = st.st_ctime;