Fixed 2 failing hunks.
[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
9a7eef96
WD
13--- old/syscall.c
14+++ new/syscall.c
03019e41 15@@ -59,9 +59,14 @@ int do_symlink(const char *fname1, const
a5e0f697 16 #ifdef HAVE_LINK
9a7eef96 17 int do_link(const char *fname1, const char *fname2)
4f77c9b9 18 {
10121225 19+ int st;
4f77c9b9 20+
10121225
WD
21 if (dry_run) return 0;
22 RETURN_ERROR_IF_RO_OR_LO;
23- return link(fname1, fname2);
24+ st = link(fname1, fname2);
25+ if (/*soften_links &&*/ st != 0 && errno == EXDEV)
26+ st = symlink(fname1, fname2);
27+ return st;
4f77c9b9
MP
28 }
29 #endif
10121225 30