bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
0791d5779d67da0983375dc01dadec4c749b6f38Timo Sirainenunlink_old_files_real(const char *dir, const char *prefix, time_t min_time)
e736ac97fd3896533f4ebf3b18a791bc3637b711Timo Sirainen /* update atime immediately, so if this scanning is done based on
e736ac97fd3896533f4ebf3b18a791bc3637b711Timo Sirainen atime it won't be done by multiple processes if the scan is slow */
0791d5779d67da0983375dc01dadec4c749b6f38Timo Sirainen (d->d_name[1] == '.' && d->d_name[2] == '\0'))) {
0791d5779d67da0983375dc01dadec4c749b6f38Timo Sirainen /* skip . and .. */
0791d5779d67da0983375dc01dadec4c749b6f38Timo Sirainen if (strncmp(d->d_name, prefix, prefix_len) != 0)
0791d5779d67da0983375dc01dadec4c749b6f38Timo Sirainen } else if (!S_ISDIR(st.st_mode) && st.st_ctime < min_time) {
0791d5779d67da0983375dc01dadec4c749b6f38Timo Sirainenint unlink_old_files(const char *dir, const char *prefix, time_t min_time)