Commit | Line | Data |
---|---|---|
03019e41 | 1 | Marco d'Itri wrote: |
4f77c9b9 MP |
2 | |
3 | I run one of the debian mirrors, and I had to write this patch because | |
4 | my archive is split between more than one disk. Would you accept a more | |
5 | polished version of this patch for inclusion in rsync? | |
6 | ||
03019e41 WD |
7 | To 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 | |
cc3e685d WD |
13 | diff --git a/syscall.c b/syscall.c |
14 | --- a/syscall.c | |
15 | +++ b/syscall.c | |
a5e6228a | 16 | @@ -63,9 +63,14 @@ int do_symlink(const char *fname1, const char *fname2) |
a5e0f697 | 17 | #ifdef HAVE_LINK |
9a7eef96 | 18 | int do_link(const char *fname1, const char *fname2) |
4f77c9b9 | 19 | { |
10121225 | 20 | + int st; |
4f77c9b9 | 21 | + |
10121225 WD |
22 | if (dry_run) return 0; |
23 | RETURN_ERROR_IF_RO_OR_LO; | |
24 | - return link(fname1, fname2); | |
25 | + st = link(fname1, fname2); | |
26 | + if (/*soften_links &&*/ st != 0 && errno == EXDEV) | |
27 | + st = symlink(fname1, fname2); | |
28 | + return st; | |
4f77c9b9 MP |
29 | } |
30 | #endif | |
10121225 | 31 |