--link-dest / --hard-links problem

Wayne Davison wayned at samba.org
Sat Apr 23 19:44:53 GMT 2005


On Sat, Apr 23, 2005 at 02:01:38PM -0500, Raphael Jaffey wrote:
> This can be easily reproduced locally with the following example:

Thanks for the test case -- it makes things really easy to fix.
Attached is a patch that fixes this bug.  It's for the CVS version
but it should apply to 2.6.4 as well.  However, if you're going to
rebuild, you might as well snag the latest "nightly" tar file from
the rsync web page and apply the patch to that.

Thanks!

..wayne..
-------------- next part --------------
--- generator.c	23 Apr 2005 17:48:31 -0000	1.204
+++ generator.c	23 Apr 2005 19:40:35 -0000
@@ -914,8 +914,15 @@ static void recv_generator(char *fname, 
 				if (hard_link_one(file, ndx, fname, -1, &st,
 						  fnamecmpbuf, 1,
 						  itemizing && verbose > 1,
-						  code) == 0)
+						  code) == 0) {
+					if (preserve_hard_links
+					    && file->link_u.links) {
+						hard_link_cluster(file, ndx,
+								  itemizing,
+								  code);
+					}
 					return;
+				}
 				match_level = 2;
 			}
 #endif


More information about the rsync mailing list