- if (st.st_mtime < before_utime || st.st_mtime > after_utime) {
- fprintf(stderr, "%s: bad utime times %lu <= %lu <= %lu false\n",
- prog, before_utime, st.st_mtime, after_utime);
- return 7;
+ if (st.st_mtime != utb.modtime) {
+ fprintf(stderr, "%s: bad utime mtime(%s) %lu should be %lu\n",
+ prog, filename, st.st_mtime, utb.modtime);
+ return 9;
+ }
+
+ if (st.st_atime != utb.actime) {
+ fprintf(stderr, "%s: bad utime atime(%s) %lu should be %lu\n",
+ prog, filename, st.st_atime, utb.actime);
+ return 10;
+ }
+
+ printf("%s: good utime mtimes %lu, atime %lu\n",
+ prog, utb.modtime, utb.actime);
+
+ if (!secname)
+ return 0;
+
+ /* Checking that times in past get updated on another client. */
+ rc = stat(secname, &st2);
+ if (rc) {
+ fprintf(stderr, "%s: second stat(%s) failed: rc %d: %s\n",
+ prog, secname, errno, strerror(errno));
+ return 12;
+ }
+
+ if (st2.st_mtime != st.st_mtime) {
+ fprintf(stderr,
+ "%s: not synced mtime(%s) between clients: %lu should be %lu\n",
+ prog, secname, st2.st_mtime, st.st_mtime);
+ return 13;
+ }
+
+ if (st2.st_ctime != st.st_ctime) {
+ fprintf(stderr,
+ "%s: not synced ctime(%s) between clients: %lu should be %lu\n",
+ prog, secname, st2.st_ctime, st.st_ctime);
+ return 14;