The patches for 3.3.0.
[rsync-patches.git] / soften-links.diff
index d58f1eea1c27181f1ef52f56de89355eb9f4f9e9..f8d128229f443d1508fbea22d7e65cc4d5527136 100644 (file)
@@ -10,22 +10,27 @@ To use this patch, run these commands for a successful build:
     ./configure                           (optional if already run)
     make
 
-based-on: faecd066a6b523713299e659d8295eb8e308f9ed
+based-on: 6c8ca91c731b7bf2b081694bda85b7dadc2b7aff
 diff --git a/syscall.c b/syscall.c
 --- a/syscall.c
 +++ b/syscall.c
-@@ -123,9 +123,14 @@ ssize_t do_readlink(const char *path, char *buf, size_t bufsiz)
- #ifdef HAVE_LINK
- int do_link(const char *fname1, const char *fname2)
+@@ -136,13 +136,18 @@ ssize_t do_readlink(const char *path, char *buf, size_t bufsiz)
+ #if defined HAVE_LINK || defined HAVE_LINKAT
+ int do_link(const char *old_path, const char *new_path)
  {
 +      int st;
 +
        if (dry_run) return 0;
        RETURN_ERROR_IF_RO_OR_LO;
--      return link(fname1, fname2);
-+      st = link(fname1, fname2);
+ #ifdef HAVE_LINKAT
+-      return linkat(AT_FDCWD, old_path, AT_FDCWD, new_path, 0);
++      st = linkat(AT_FDCWD, old_path, AT_FDCWD, new_path, 0);
+ #else
+-      return link(old_path, new_path);
++      st = link(old_path, new_path);
+ #endif
 +      if (/*soften_links &&*/ st != 0 && errno == EXDEV)
-+              st = symlink(fname1, fname2);
++              st = symlink(old_path, new_path);
 +      return st;
  }
  #endif