21 lines
907 B
Plaintext
21 lines
907 B
Plaintext
--- test.c
|
|
+++ test.c 2012-03-06 11:14:00.149934027 +0000
|
|
@@ -309,8 +309,17 @@ filecomp (s, t, op)
|
|
|
|
switch (op)
|
|
{
|
|
+#if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || (defined(_XOPEN_SOURCE) && ((_XOPEN_SOURCE - 0) >= 700)) || (defined(_POSIX_C_SOURCE) && ((_POSIX_C_SOURCE - 0) >= 200809L))
|
|
+# define st_mtimcmp(t1, t2, CMP) \
|
|
+ (((t1).st_mtim.tv_sec == (t2).st_mtim.tv_sec) ? \
|
|
+ ((t1).st_mtim.tv_nsec CMP (t2).st_mtim.tv_nsec) : \
|
|
+ ((t1).st_mtim.tv_sec CMP (t2).st_mtim.tv_sec))
|
|
+ case OT: return (r1 < r2 || (r2 == 0 && st_mtimcmp(st1, st2, <)));
|
|
+ case NT: return (r1 > r2 || (r1 == 0 && st_mtimcmp(st1, st2, >)));
|
|
+#else
|
|
case OT: return (r1 < r2 || (r2 == 0 && st1.st_mtime < st2.st_mtime));
|
|
case NT: return (r1 > r2 || (r1 == 0 && st1.st_mtime > st2.st_mtime));
|
|
+#endif
|
|
case EF: return (same_file (s, t, &st1, &st2));
|
|
}
|
|
return (FALSE);
|