On Haiku, I see this test failure:

FAIL: test-unlinkat
===================

../../gltests/test-rmdir.h:44: assertion 'errno == EINVAL || errno == EBUSY' 
failed
Abort
FAIL test-unlinkat (exit status: 149)

With this patch, the assertion succeeds, and the test merely fails later.


2026-01-17  Bruno Haible  <[email protected]>

        unlinkat tests: Avoid a test failure on Haiku.
        * tests/test-rmdir.h (test_rmdir_func): Accept EPERM error.

diff --git a/tests/test-rmdir.h b/tests/test-rmdir.h
index 5fd5cf6564..d071147064 100644
--- a/tests/test-rmdir.h
+++ b/tests/test-rmdir.h
@@ -41,7 +41,8 @@ test_rmdir_func (int (*func) (char const *name), bool print)
   ASSERT (errno == ENOENT);
   errno = 0;
   ASSERT (func (".") == -1);
-  ASSERT (errno == EINVAL || errno == EBUSY);
+  ASSERT (errno == EINVAL || errno == EBUSY
+          || errno == EPERM /* Haiku */);
   /* Resulting errno after ".." or "/" is too varied to test; it is
      reasonable to see any of EINVAL, EBUSY, EEXIST, ENOTEMPTY,
      EACCES, EPERM.  */




Reply via email to