| 1 | Date: Fri, 12 Apr 2002 13:44:22 +0200 |
| 2 | From: Marco d'Itri <md@Linux.IT> |
| 3 | To: mbp@samba.org |
| 4 | Subject: rsync and debian mirrors |
| 5 | |
| 6 | I run one of the debian mirrors, and I had to write this patch because |
| 7 | my archive is split between more than one disk. Would you accept a more |
| 8 | polished version of this patch for inclusion in rsync? |
| 9 | |
| 10 | [Updated to latest CVS source by Wayne Davison.] |
| 11 | |
| 12 | --- old/syscall.c |
| 13 | +++ new/syscall.c |
| 14 | @@ -62,9 +62,14 @@ int do_symlink(const char *fname1, const |
| 15 | #ifdef HAVE_LINK |
| 16 | int do_link(const char *fname1, const 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 | |