Moved one fsync() call.
[rsync-patches.git] / soften-links.diff
index 82be9746960a8bd7843e08f5703fb18a8f9173fb..d8f9d1d7abe92ee17e5adefe47aa2f4fe4762df0 100644 (file)
@@ -1,51 +1,30 @@
-From md@Linux.IT Fri Apr 12 21:45:04 2002
-Return-Path: <md@Linux.IT>
-Delivered-To: mbp@samba.org
-Received: from attila.bofh.it (attila.bofh.it [213.92.8.2])
-       by lists.samba.org (Postfix) with ESMTP id 1D3674500
-       for <mbp@samba.org>; Fri, 12 Apr 2002 04:45:04 -0700 (PDT)
-Received: by attila.bofh.it (Postfix, from userid 10)
-       id 462BB5FA70; Fri, 12 Apr 2002 13:44:29 +0200 (CEST)
-Received: by wonderland.linux.it (Postfix/Md, from userid 1001)
-       id D8B4E33B2D; Fri, 12 Apr 2002 13:44:22 +0200 (CEST)
-Date: Fri, 12 Apr 2002 13:44:22 +0200
-From: Marco d'Itri <md@Linux.IT>
-To: mbp@samba.org
-Subject: rsync and debian mirrors
-Message-ID: <20020412114422.GA1664@wonderland.linux.it>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-User-Agent: Mutt/1.3.28i
-Status: RO
-X-Status: A
-Content-Length: 658
-Lines: 26
+Marco d'Itri wrote:
 
 I run one of the debian mirrors, and I had to write this patch because
 my archive is split between more than one disk. Would you accept a more
 polished version of this patch for inclusion in rsync?
 
---- syscall.c.orig      Thu May 31 16:14:07 2001
-+++ syscall.c   Thu May 31 16:40:46 2001
-@@ -45,9 +45,14 @@
- #if HAVE_LINK
- int do_link(char *fname1, char *fname2)
+To use this patch, run these commands for a successful build:
+
+    patch -p1 <patches/soften-links.diff
+    ./configure                           (optional if already run)
+    make
+
+--- old/syscall.c
++++ new/syscall.c
+@@ -59,9 +59,14 @@ int do_symlink(const char *fname1, const
+ #ifdef HAVE_LINK
+ int do_link(const char *fname1, const char *fname2)
  {
-+       int st;
++      int st;
 +
-        if (dry_run) return 0;
-        CHECK_RO
--       return link(fname1, fname2);
-+       st = link(fname1, fname2);
-+       if (/*soften_links &&*/ st != 0 && errno == EXDEV)
-+               st = symlink(fname1, fname2);
-+       return st;
+       if (dry_run) return 0;
+       RETURN_ERROR_IF_RO_OR_LO;
+-      return link(fname1, fname2);
++      st = link(fname1, fname2);
++      if (/*soften_links &&*/ st != 0 && errno == EXDEV)
++              st = symlink(fname1, fname2);
++      return st;
  }
  #endif
-
-
--- 
-ciao,
-Marco
-