The patches for 3.3.0.
[rsync-patches.git] / soften-links.diff
index 6ec45eeaa78a5d3af9a126f927c9eb8a6b01de42..f8d128229f443d1508fbea22d7e65cc4d5527136 100644 (file)
@@ -10,20 +10,25 @@ To use this patch, run these commands for a successful build:
     ./configure                           (optional if already run)
     make
 
-based-on: c225330aaf9d6032a79317bda1bf669e90ac7212
+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
+@@ -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;
+ #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(old_path, new_path);
 +      return st;