2009-10-09 Eric Blake <ebb9@byu.net>
+ test-stat-time: port to buggy NFS clients
+ * tests/test-stat-time.c (main) [W32]: Reduce ifdefs.
+ (test_ctime): Also skip test if mtime and ctime are skewed.
+
maint: prefer 'file system' over 'filesystem'
* doc/posix-functions/fstatat.texi (fstatat): Likewise.
* doc/posix-functions/lstat.texi (lstat): Likewise.
}
}
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+/* Skip the ctime tests on native Windows platforms, because their
+ st_ctime is either the same as st_mtime (plus or minus an offset)
+ or set to the file _creation_ time, and is not influenced by rename
+ or chmod. */
+# define test_ctime ((void) 0)
+#else
static void
test_ctime (const struct stat *statinfo)
{
+ /* On some buggy NFS clients, mtime and ctime are disproportionately
+ skewed from one another. Skip this test in that case. */
+ if (statinfo[0].st_mtime != statinfo[0].st_ctime)
+ return;
+
/* mtime(stamp2) < ctime(renamed) */
ASSERT (statinfo[2].st_mtime < statinfo[1].st_ctime
|| (statinfo[2].st_mtime == statinfo[1].st_ctime
cleanup (0);
prepare_test (statinfo, modtimes);
test_mtime (statinfo, modtimes);
- /* Skip the ctime tests on native Windows platforms, because there st_ctime
- is either the same as st_mtime (plus or minus an offset) or set to the
- file _creation_ time, and is not influenced by rename or chmod. */
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
test_ctime (statinfo);
-#endif
test_birthtime (statinfo, modtimes, birthtimes);
cleanup (0);