* tests/test-link.h (test_link): On Android, treat an EACCES failure
like EPERM.
* tests/test-linkat.c (main): When test_link is marked skipped, skip the
rest of the test as well.
+2023-01-11 Bruno Haible <bruno@clisp.org>
+
+ link, linkat tests: Fix test failures on Android/Termux.
+ * tests/test-link.h (test_link): On Android, treat an EACCES failure
+ like EPERM.
+ * tests/test-linkat.c (main): When test_link is marked skipped, skip the
+ rest of the test as well.
+
2023-01-11 Bruno Haible <bruno@clisp.org>
link tests: Correct indentation.
if (ret == -1)
{
/* If the device does not support hard links, errno is
- EPERM on Linux, EOPNOTSUPP on FreeBSD. */
+ EPERM on Linux,
+ EOPNOTSUPP on FreeBSD,
+ EACCES on Android within Termux. */
switch (errno)
{
case EPERM:
case EOPNOTSUPP:
+ #if defined __ANDROID__
+ case EACCES:
+ #endif
if (print)
fputs ("skipping test: "
"hard links not supported on this file system\n",
dfd1 = AT_FDCWD;
ASSERT (test_link (do_link, false) == result);
+ /* Skip the rest of the test if the file system does not support hard links
+ and symlinks. */
+ if (result)
+ return result;
+
/* Create locations to manipulate. */
ASSERT (mkdir (BASE "sub1", 0700) == 0);
ASSERT (mkdir (BASE "sub2", 0700) == 0);