From fbf7f938fb6bd6d2bd2171c28d0626c0b99feab2 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Thu, 16 Mar 2023 21:47:11 +0100 Subject: [PATCH] Fix: expire cache on filename change as well --- src/ctpv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ctpv.c b/src/ctpv.c index 4dcf91d..1a55706 100644 --- a/src/ctpv.c +++ b/src/ctpv.c @@ -144,10 +144,10 @@ static RESULT is_newer(int *resp, char *f1, char *f2) ERRCHK_RET_ERN(lstat(f1, &stat1) == -1); ERRCHK_RET_ERN(lstat(f2, &stat2) == -1); - int sec_d = stat1.st_mtim.tv_sec - stat2.st_mtim.tv_sec; + int sec_d = stat1.st_ctim.tv_sec - stat2.st_ctim.tv_sec; if (sec_d < 0) goto older; - else if (sec_d == 0 && stat1.st_mtim.tv_nsec <= stat2.st_mtim.tv_nsec) + else if (sec_d == 0 && stat1.st_ctim.tv_nsec <= stat2.st_ctim.tv_nsec) goto older; *resp = 1;