crtimes discrepancy on PPC

Mike Bombich mike at bombich.com
Mon Sep 29 14:49:26 GMT 2008


On a PPC machine running Mac OS X, I noticed that creation time is not  
preserved for files that are transferred (i.e. versus files that are  
not transferred, or files that have only attribute changes).  I  
discovered two things that work together to cause this:

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.  Of course, a file's crtime should  
never be negative, which leads me to #2.

2) set_file_attrs (rsync.c) doesn't initialize sx2.crtime (e.g. when  
the sxp argument is NULL).  This leads to crtime values that are  
occasionally > 2^31, resulting in negative crtimes.

The attached patch resolves these.

Mike

-------------- next part --------------
A non-text attachment was scrubbed...
Name: crtimes_ppc.patch
Type: application/octet-stream
Size: 704 bytes
Desc: not available
Url : http://lists.samba.org/archive/rsync/attachments/20080929/27b16716/crtimes_ppc.obj
-------------- next part --------------



More information about the rsync mailing list