]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Make symlink return EEXIST on existing target directory
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 21 Apr 2025 20:21:17 +0000 (22:21 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 21 Apr 2025 21:08:17 +0000 (23:08 +0200)
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.

sysdeps/mach/hurd/symlinkat.c

index e7dfb673df84a23b7659f5864bba927c18432e71..cb6250e6f0780ba786a3b76762650df8e301aa3a 100644 (file)
@@ -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);