./configure (optional if already run)
make
-based-on: a1cc50ba96d212c0647a91bf56e3de25eb35bd56
+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;