From 82c416d7aec0a8bd52fa8c3b6c1b2cc589b407fb Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sat, 18 Jan 2025 18:00:55 -0800 Subject: [PATCH] linkat tests: Revert the last change. * tests/test-linkat.c (main): Disallow EINVAL an alternative error value. * doc/posix-functions/linkat.texi: Document the GNU/Hurd bug. --- ChangeLog | 5 +++++ doc/posix-functions/linkat.texi | 6 ++++++ tests/test-linkat.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 19332fa253..2057a6da9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2025-01-18 Collin Funk + linkat tests: Revert the last change. + * tests/test-linkat.c (main): Disallow EINVAL an alternative error + value. + * doc/posix-functions/linkat.texi: Document the GNU/Hurd bug. + linkat tests: Avoid failure on GNU/Hurd. * tests/test-linkat.c (main): Allow EINVAL an alternative error value. diff --git a/doc/posix-functions/linkat.texi b/doc/posix-functions/linkat.texi index 2c2eeb0e94..ceeddaff6c 100644 --- a/doc/posix-functions/linkat.texi +++ b/doc/posix-functions/linkat.texi @@ -27,4 +27,10 @@ Linux kernel 2.6.17. Portability problems not fixed by Gnulib: @itemize +@item +@code{linkat (fd, "directory", fd, "symlink/" ...)} sets @code{errno} +to @code{EINVAL} instead of @code{EEXIST} or @code{ENOTDIR} on some +platforms: +@c https://sourceware.org/bugzilla/show_bug.cgi?id=32569 +GNU/Hurd. @end itemize diff --git a/tests/test-linkat.c b/tests/test-linkat.c index 80e7222c43..5fd2e37ebf 100644 --- a/tests/test-linkat.c +++ b/tests/test-linkat.c @@ -223,7 +223,7 @@ main (void) ASSERT (errno == EEXIST || errno == EPERM || errno == EACCES); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1/", 0) == -1); - ASSERT (errno == EEXIST || errno == ENOTDIR || errno == EINVAL); + ASSERT (errno == EEXIST || errno == ENOTDIR); errno = 0; ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1", AT_SYMLINK_FOLLOW) == -1); -- 2.39.5