[PATCH] Consider nanoseconds when quick-checking for unchanged files

Ingo Brückl ib at wupperonline.de
Fri Jan 2 08:02:27 MST 2015


Hi,

I obviously didn't think of --modify-window, so in order to not behave
erratically it should be at least:

--- a/generator.c	2014-06-14 01:05:08.000000000 +0200
+++ b/generator.c	2015-01-02 15:50:30.000000000 +0100
@@ -588,7 +588,14 @@
 	if (ignore_times)
 		return 0;

-	return cmp_time(st->st_mtime, file->modtime) == 0;
+	return cmp_time(st->st_mtime, file->modtime) == 0
+#ifdef ST_MTIME_NSEC
+	       ? st->st_mtime == file->modtime
+	         && NSEC_BUMP(file) ? (uint32)st->ST_MTIME_NSEC == F_MOD_NSEC(file)
+	                            : 1
+	       : 0
+#endif
+	;
 }



Most probably, the check should be part of cmp_time(), but I can't overview
possible consequences and I don't know whether such a change would have a
chance to be accepted and hence is worth the effort.

Ingo


More information about the rsync mailing list