Commit | Line | Data |
---|---|---|
4f77c9b9 MP |
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 | |
4f77c9b9 MP |
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 | ||
10121225 WD |
10 | [Updated to latest CVS source by Wayne Davison.] |
11 | ||
388bf7cc | 12 | --- orig/syscall.c 2005-04-07 17:04:26 |
13bed3dd | 13 | +++ syscall.c 2004-04-22 23:48:45 |
a7219d20 | 14 | @@ -62,9 +62,14 @@ int do_symlink(char *fname1, char *fname |
a5e0f697 | 15 | #ifdef HAVE_LINK |
4f77c9b9 MP |
16 | int do_link(char *fname1, char *fname2) |
17 | { | |
10121225 | 18 | + int st; |
4f77c9b9 | 19 | + |
10121225 WD |
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; | |
4f77c9b9 MP |
27 | } |
28 | #endif | |
10121225 | 29 |