X-Git-Url: http://git.samba.org/?p=rsync-patches.git;a=blobdiff_plain;f=soften-links.diff;h=8e1ab552fb51fa53312f6586d6f53c673f495bc7;hp=6ec45eeaa78a5d3af9a126f927c9eb8a6b01de42;hb=HEAD;hpb=7af5e50321c7f9be7cb19efef0df00f9075fd5cc diff --git a/soften-links.diff b/soften-links.diff index 6ec45ee..f8d1282 100644 --- a/soften-links.diff +++ b/soften-links.diff @@ -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;