]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clean up files with identical timestamps in ascending name order
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 7 Jun 2010 21:24:30 +0000 (23:24 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 7 Jun 2010 21:24:30 +0000 (23:24 +0200)
cleanup.c

index 97f9f8ecce7eef1f4b17c0af1deca2a16ff7797a..f38ccbca2222e060fead73e95795007c20124349 100644 (file)
--- 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;