1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-04-28 06:33:36 +00:00

utimens: Use issymlink.

* lib/utimens.c (lutimens): Use issymlink instead of readlink.
* modules/utimens (Depends-on): Remove readlink. Add issymlink.
This commit is contained in:
Bruno Haible
2025-08-14 22:34:17 +02:00
parent 8f61201292
commit 4890a0c51a
3 changed files with 10 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2025-08-14 Bruno Haible <bruno@clisp.org>
utimens: Use issymlink.
* lib/utimens.c (lutimens): Use issymlink instead of readlink.
* modules/utimens (Depends-on): Remove readlink. Add issymlink.
2025-08-14 Bruno Haible <bruno@clisp.org>
unlinkat: Use issymlinkat.

View File

@@ -675,10 +675,10 @@ lutimens (char const *file, struct timespec const timespec[2])
not_symlink = !S_ISLNK (st.st_mode);
else
{
char linkbuf[1];
not_symlink = readlink (file, linkbuf, 1) < 0;
if (not_symlink && errno != EINVAL)
int ret = issymlink (file);
if (ret < 0)
return -1;
not_symlink = !ret;
}
if (not_symlink)
return fdutimens (-1, file, ts);

View File

@@ -14,8 +14,8 @@ fcntl-h
fstat
lstat
gettime
issymlink
msvc-nothrow
readlink
stat
stat-time
bool