aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-21 22:21:17 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-21 23:08:17 +0200
commit39183b953c68a489cc0b9aefb8974711c834fb38 (patch)
tree0b9e2b6c0cfb86893d32dea26df821cbe6417b99
parent0d9971468087c77e8727638123ae4aa60724e0ff (diff)
downloadglibc-39183b953c68a489cc0b9aefb8974711c834fb38.tar.xz
glibc-39183b953c68a489cc0b9aefb8974711c834fb38.zip
hurd: Make symlink return EEXIST on existing target directory
8ef17919509e ("hurd: Fix EINVAL error on linking to a slash-trailing path [BZ #32569]) made symlink return ENOTDIR, but the gnulib testsuite does not recognize it for such a situation, and EEXIST is indeed more comprehensible to users.
-rw-r--r--sysdeps/mach/hurd/symlinkat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c
index e7dfb673df..cb6250e6f0 100644
--- a/sysdeps/mach/hurd/symlinkat.c
+++ b/sysdeps/mach/hurd/symlinkat.c
@@ -47,7 +47,7 @@ __symlinkat (const char *from, int fd, const char *to)
if (! *name)
/* Can't link to the existing directory itself. */
- err = ENOTDIR;
+ err = EEXIST;
else
/* Create a new, unlinked node in the target directory. */
err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node);