Instead of using pure atimes, I think we should generally use
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 28 Nov 2008 19:15:15 +0000 (19:15 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 28 Nov 2008 19:15:15 +0000 (19:15 +0000)
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
agedu.h
index.c

diff --git a/agedu.c b/agedu.c
index 9ff6bb8..99fa1f8 100644 (file)
--- 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 (file)
--- 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 (file)
--- 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 {