From: Joel Rosdahl Date: Mon, 7 Jun 2010 21:24:30 +0000 (+0200) Subject: Clean up files with identical timestamps in ascending name order X-Git-Tag: v3.0~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c6d63f7507b9371984f4e450ad583a9931a0daf8;p=thirdparty%2Fccache.git Clean up files with identical timestamps in ascending name order --- diff --git a/cleanup.c b/cleanup.c index 97f9f8ecc..f38ccbca2 100644 --- a/cleanup.c +++ b/cleanup.c @@ -71,11 +71,11 @@ static int is_object_file(const char *fname) return 1; } -/* file comparison function to try to delete the oldest files first */ +/* File comparison function that orders files in mtime order, oldest first. */ static int files_compare(struct files **f1, struct files **f2) { if ((*f2)->mtime == (*f1)->mtime) { - return strcmp((*f2)->fname, (*f1)->fname); + return strcmp((*f1)->fname, (*f2)->fname); } if ((*f2)->mtime > (*f1)->mtime) { return -1;