Updated patches to work with the current trunk.
[rsync/rsync-patches.git] / soften-links.diff
CommitLineData
03019e41 1Marco d'Itri wrote:
4f77c9b9
MP
2
3I run one of the debian mirrors, and I had to write this patch because
4my archive is split between more than one disk. Would you accept a more
5polished version of this patch for inclusion in rsync?
6
03019e41
WD
7To use this patch, run these commands for a successful build:
8
9 patch -p1 <patches/soften-links.diff
10 ./configure (optional if already run)
11 make
10121225 12
5214a41b 13based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
cc3e685d
WD
14diff --git a/syscall.c b/syscall.c
15--- a/syscall.c
16+++ b/syscall.c
72e5645e 17@@ -106,9 +106,14 @@ ssize_t do_readlink(const char *path, char *buf, size_t bufsiz)
a5e0f697 18 #ifdef HAVE_LINK
9a7eef96 19 int do_link(const char *fname1, const char *fname2)
4f77c9b9 20 {
10121225 21+ int st;
4f77c9b9 22+
10121225
WD
23 if (dry_run) return 0;
24 RETURN_ERROR_IF_RO_OR_LO;
25- return link(fname1, fname2);
26+ st = link(fname1, fname2);
27+ if (/*soften_links &&*/ st != 0 && errno == EXDEV)
28+ st = symlink(fname1, fname2);
29+ return st;
4f77c9b9
MP
30 }
31 #endif
10121225 32