* lib/unlink.c (rpl_unlink): Use issymlink instead of readlink.
* modules/unlink (Depends-on): Remove readlink. Add issymlink.
+2025-08-14 Bruno Haible <bruno@clisp.org>
+
+ unlink: Use issymlink.
+ * lib/unlink.c (rpl_unlink): Use issymlink instead of readlink.
+ * modules/unlink (Depends-on): Remove readlink. Add issymlink.
+
2025-08-14 Bruno Haible <bruno@clisp.org>
renameatu: Use issymlinkat.
memcpy (short_name, name, len);
while (len && ISSLASH (short_name[len - 1]))
short_name[--len] = '\0';
- char linkbuf[1];
- if (len && ! (readlink (short_name, linkbuf, 1) < 0
- && errno == EINVAL))
+ if (len && issymlink (short_name) != 0)
{
free (short_name);
errno = EPERM;
Depends-on:
unistd-h
filename [test $REPLACE_UNLINK = 1]
+issymlink [test $REPLACE_UNLINK = 1]
lstat [test $REPLACE_UNLINK = 1]
malloc-posix [test $REPLACE_UNLINK = 1]
-readlink [test $REPLACE_UNLINK = 1]
configure.ac:
gl_FUNC_UNLINK