On Mon, Sep 29, 2008 at 09:49:26AM -0500, Mike Bombich wrote:
> 1) cmp_time (util.c) doesn't check for negative values provided in file1 or 
> file2.  If file2 is positive, and file1 is negative, and 
> absolute_value(file1) > file2, cmp_time returns 0, even though the times 
> are obviously different.

Yeah, that's a subtle one.  I've changed it in a little simpler way:
reordering the args in the ifs so that an underflow can't trigger a
spurious successful test.  Patch attached.

> 2) set_file_attrs (rsync.c) doesn't initialize sx2.crtime (e.g. when the 
> sxp argument is NULL).

Thanks!  I've applied that change to the crtimes diff.

..wayne..
--- a/util.c
+++ b/util.c
@@ -1280,11 +1280,11 @@ int msleep(int t)
 int cmp_time(time_t file1, time_t file2)
 {
 	if (file2 > file1) {
-		if (file2 - file1 <= modify_window)
+		if (file2 - modify_window <= file1)
 			return 0;
 		return -1;
 	}
-	if (file1 - file2 <= modify_window)
+	if (file1 - modify_window <= file2)
 		return 0;
 	return 1;
 }
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to