File: git-symlink-eexist.diff

package info (click to toggle)
glibc 2.41-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300,384 kB
  • sloc: ansic: 1,050,583; asm: 238,243; makefile: 20,379; python: 13,537; sh: 11,827; cpp: 5,197; awk: 1,795; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (22 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
commit 1eb32c5788a59b821087f971821536a22a3b65de
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Apr 21 22:21:17 2025 +0200

    hurd: Make symlink return EEXIST on existing target directory
    
    The gnulib testsuite does not recognize ENOTDIR for such a situation,
    and this error is indeed more comprehensible to users.

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);