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