From 7e25423cd18ab429b13c6e2ea920d9c44c0f263c Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 28 Nov 2008 19:15:15 +0000 Subject: [PATCH] Instead of using pure atimes, I think we should generally use max(atime, mtime). A file that's been recently modified is surely in use as much as one recently read. git-svn-id: svn://svn.tartarus.org/sgt/agedu@8341 cda61777-01e9-0310-a592-d414129be87e --- agedu.c | 2 +- agedu.h | 3 +++ index.c | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agedu.c b/agedu.c index 9ff6bb8..99fa1f8 100644 --- a/agedu.c +++ b/agedu.c @@ -90,7 +90,7 @@ static int gotdata(void *vctx, const char *pathname, const STRUCT_STAT *st) if (ctx->usemtime || (ctx->fakeatimes && S_ISDIR(st->st_mode))) file.atime = st->st_mtime; else - file.atime = st->st_atime; + file.atime = max(st->st_mtime, st->st_atime); /* * Filter based on wildcards. diff --git a/agedu.h b/agedu.h index 2e6cc51..5a4e72b 100644 --- a/agedu.h +++ b/agedu.h @@ -106,3 +106,6 @@ extern char pathsep; #define LSTAT lstat #define STAT stat #endif + +#define max(x,y) ( (x) > (y) ? (x) : (y) ) +#define min(x,y) ( (x) < (y) ? (x) : (y) ) diff --git a/index.c b/index.c index 28119c8..1cdb2ea 100644 --- a/index.c +++ b/index.c @@ -9,9 +9,6 @@ #define alignof(typ) ( offsetof(struct { char c; typ t; }, t) ) -#define min(x,y) ((x)<(y) ? (x):(y)) -#define max(x,y) ((x)>(y) ? (x):(y)) - #define PADDING(x, mod) ( ((mod) - ((x) % (mod))) % (mod) ) struct avlnode { -- 2.11.0