We should not use the date in the header when patching, because that
[rsync/rsync-patches.git] / soften-links.diff
... / ...
CommitLineData
1Date: Fri, 12 Apr 2002 13:44:22 +0200
2From: Marco d'Itri <md@Linux.IT>
3To: mbp@samba.org
4Subject: rsync and debian mirrors
5
6I run one of the debian mirrors, and I had to write this patch because
7my archive is split between more than one disk. Would you accept a more
8polished version of this patch for inclusion in rsync?
9
10[Updated to latest CVS source by Wayne Davison.]
11
12--- orig/syscall.c 2005-04-07 17:04:26
13+++ syscall.c 2004-04-22 23:48:45
14@@ -62,9 +62,14 @@ int do_symlink(char *fname1, char *fname
15 #ifdef HAVE_LINK
16 int do_link(char *fname1, char *fname2)
17 {
18+ int st;
19+
20 if (dry_run) return 0;
21 RETURN_ERROR_IF_RO_OR_LO;
22- return link(fname1, fname2);
23+ st = link(fname1, fname2);
24+ if (/*soften_links &&*/ st != 0 && errno == EXDEV)
25+ st = symlink(fname1, fname2);
26+ return st;
27 }
28 #endif
29