From 48d391e4d8f21a50a25dbf13d26cb9a690c47d22 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Tue, 3 Sep 2024 13:32:40 +0200
Subject: [PATCH] unlockpt tests: Avoid test failure on Haiku.

* tests/test-unlockpt.c (main): Skip the test on Haiku.
* doc/posix-functions/unlockpt.texi: Update platforms list.
---
 ChangeLog                         | 6 ++++++
 doc/posix-functions/unlockpt.texi | 2 +-
 tests/test-unlockpt.c             | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7358fb3902..dc9fea3286 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-09-03  Bruno Haible  <bruno@clisp.org>
+
+	unlockpt tests: Avoid test failure on Haiku.
+	* tests/test-unlockpt.c (main): Skip the test on Haiku.
+	* doc/posix-functions/unlockpt.texi: Update platforms list.
+
 2024-09-02  Bruno Haible  <bruno@clisp.org>
 
 	utime, futimens tests: Avoid test failure on Haiku.
diff --git a/doc/posix-functions/unlockpt.texi b/doc/posix-functions/unlockpt.texi
index 2f5b3da6ef..d696e5343c 100644
--- a/doc/posix-functions/unlockpt.texi
+++ b/doc/posix-functions/unlockpt.texi
@@ -17,5 +17,5 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 This function reports success for invalid file descriptors on some platforms:
-NetBSD 5.1, Cygwin 1.7.9.
+NetBSD 5.1, Cygwin 1.7.9, Haiku.
 @end itemize
diff --git a/tests/test-unlockpt.c b/tests/test-unlockpt.c
index 9f5e7735f4..c3f5e531f1 100644
--- a/tests/test-unlockpt.c
+++ b/tests/test-unlockpt.c
@@ -30,7 +30,7 @@ int
 main (void)
 {
   /* Test behaviour for invalid file descriptors.  */
-#if !defined __NetBSD__ /* known bug on NetBSD 5.1 */
+#if !(defined __NetBSD__ || defined __HAIKU__) /* known bug on NetBSD 5.1, Haiku */
   {
     errno = 0;
     ASSERT (unlockpt (-1) == -1);
-- 
2.39.5