* lib/rename.c (rpl_rename): Use issymlink instead of readlink.
* modules/rename (Depends-on): Remove readlink. Add issymlink.
+2025-08-14 Bruno Haible <bruno@clisp.org>
+
+ rename: Use issymlink.
+ * lib/rename.c (rpl_rename): Use issymlink instead of readlink.
+ * modules/rename (Depends-on): Remove readlink. Add issymlink.
+
2025-08-14 Bruno Haible <bruno@clisp.org>
fchmodat: Use issymlinkat.
goto out;
}
strip_trailing_slashes (src_temp);
- char linkbuf[1];
- if (0 <= readlink (src_temp, linkbuf, 1))
+ int ret = issymlink (src_temp);
+ if (ret > 0)
goto out;
- if (errno != EINVAL)
+ if (ret < 0)
{
rename_errno = errno;
goto out;
goto out;
}
strip_trailing_slashes (dst_temp);
- char linkbuf[1];
- if (0 <= readlink (dst_temp, linkbuf, 1))
+ int ret = issymlink (dst_temp);
+ if (ret > 0)
goto out;
- if (errno != EINVAL && errno != ENOENT)
+ if (ret < 0 && errno != ENOENT)
{
rename_errno = errno;
goto out;
chdir [test $REPLACE_RENAME = 1]
dirname-lgpl [test $REPLACE_RENAME = 1]
free-posix [test $REPLACE_RENAME = 1]
+issymlink [test $REPLACE_RENAME = 1]
lstat [test $REPLACE_RENAME = 1]
-readlink [test $REPLACE_RENAME = 1]
rmdir [test $REPLACE_RENAME = 1]
same-inode [test $REPLACE_RENAME = 1]
stat [test $REPLACE_RENAME = 1]