Fixed failing hunks.
[rsync-patches.git] / soften-links.diff
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 --- orig/syscall.c      2005-01-28 23:01:10
13 +++ syscall.c   2004-04-22 23:48:45
14 @@ -62,9 +62,14 @@ int do_symlink(char *fname1, char *fname
15  #if HAVE_LINK
16  int do_link(char *fname1, 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