The following check caused the linkat tests to fail on GNU/Hurd:

   ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1/", 0) == -1);
   ASSERT (errno == EEXIST || errno == ENOTDIR);

Where "link1" was an existing directory and "sub1" was an existing
symlink to a directory. Once we allow errno == EINVAL for this case the
tests pass.

I've just gone ahead and pushed the attached since I don't think the
errno is worth correcting in this case.

Collin

>From 9f065777c811130d9b6b539dbbedc9924d6f7916 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sat, 18 Jan 2025 16:34:14 -0800
Subject: [PATCH] linkat tests: Avoid failure on GNU/Hurd.

* tests/test-linkat.c (main): Allow EINVAL an alternative error value.
---
 ChangeLog           | 5 +++++
 tests/test-linkat.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index bd3417c7ef..19332fa253 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-01-18  Collin Funk  <collin.fu...@gmail.com>
+
+	linkat tests: Avoid failure on GNU/Hurd.
+	* tests/test-linkat.c (main): Allow EINVAL an alternative error value.
+
 2025-01-17  Paul Eggert  <egg...@cs.ucla.edu>
 
 	alignasof: port to IBM XL C V16.1
diff --git a/tests/test-linkat.c b/tests/test-linkat.c
index 5fd2e37ebf..80e7222c43 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);
+  ASSERT (errno == EEXIST || errno == ENOTDIR || errno == EINVAL);
   errno = 0;
   ASSERT (linkat (dfd, BASE "link1", dfd, BASE "sub1",
                   AT_SYMLINK_FOLLOW) == -1);
-- 
2.48.1

Reply via email to