This is now in CVS.
[rsync/rsync-patches.git] / soften-links.diff
CommitLineData
4f77c9b9
MP
1From md@Linux.IT Fri Apr 12 21:45:04 2002
2Return-Path: <md@Linux.IT>
3Delivered-To: mbp@samba.org
4Received: from attila.bofh.it (attila.bofh.it [213.92.8.2])
5 by lists.samba.org (Postfix) with ESMTP id 1D3674500
6 for <mbp@samba.org>; Fri, 12 Apr 2002 04:45:04 -0700 (PDT)
7Received: by attila.bofh.it (Postfix, from userid 10)
8 id 462BB5FA70; Fri, 12 Apr 2002 13:44:29 +0200 (CEST)
9Received: by wonderland.linux.it (Postfix/Md, from userid 1001)
10 id D8B4E33B2D; Fri, 12 Apr 2002 13:44:22 +0200 (CEST)
11Date: Fri, 12 Apr 2002 13:44:22 +0200
12From: Marco d'Itri <md@Linux.IT>
13To: mbp@samba.org
14Subject: rsync and debian mirrors
15Message-ID: <20020412114422.GA1664@wonderland.linux.it>
16Mime-Version: 1.0
17Content-Type: text/plain; charset=us-ascii
18Content-Disposition: inline
19User-Agent: Mutt/1.3.28i
20Status: RO
21X-Status: A
22Content-Length: 658
23Lines: 26
24
25I run one of the debian mirrors, and I had to write this patch because
26my archive is split between more than one disk. Would you accept a more
27polished version of this patch for inclusion in rsync?
28
29--- syscall.c.orig Thu May 31 16:14:07 2001
30+++ syscall.c Thu May 31 16:40:46 2001
31@@ -45,9 +45,14 @@
32 #if HAVE_LINK
33 int do_link(char *fname1, char *fname2)
34 {
35+ int st;
36+
37 if (dry_run) return 0;
38 CHECK_RO
39- return link(fname1, fname2);
40+ st = link(fname1, fname2);
41+ if (/*soften_links &&*/ st != 0 && errno == EXDEV)
42+ st = symlink(fname1, fname2);
43+ return st;
44 }
45 #endif
46
47
48--
49ciao,
50Marco
51