summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-01-27 04:57:24 +0100
committerBruno Haible <bruno@clisp.org>2019-01-27 04:57:24 +0100
commitadec7ef4a7f77dfbe13f6f0cda797e57f0b715d6 (patch)
tree5402a214a1391afc1e792358ecc77727fc3a201e
parenta3d1c7849936e481ae10dea5312a36a448a5d5bf (diff)
downloadgnulib-adec7ef4a7f77dfbe13f6f0cda797e57f0b715d6.tar.gz
fts: Add support for Android.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Avoid conflicts between the symbols defined by this module and the ones in libc. * tests/test-fts.c (main): Treat mkdir error EMLINK like EMFILE.
-rw-r--r--ChangeLog7
-rw-r--r--m4/fts.m420
-rw-r--r--tests/test-fts.c6
3 files changed, 30 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 21fade7382..e0aaf8f197 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2019-01-26 Bruno Haible <bruno@clisp.org>
+ fts: Add support for Android.
+ * m4/fts.m4 (gl_FUNC_FTS_CORE): Avoid conflicts between the symbols
+ defined by this module and the ones in libc.
+ * tests/test-fts.c (main): Treat mkdir error EMLINK like EMFILE.
+
+2019-01-26 Bruno Haible <bruno@clisp.org>
+
mountlist: Use Linux code on Android.
* lib/mountlist.c (setmntent, endmntent): Define fallbacks.
(unescape_tab, read_file_system_list): Enable Linux code on Android
diff --git a/m4/fts.m4 b/m4/fts.m4
index a9bf6a6d99..fa51ab465b 100644
--- a/m4/fts.m4
+++ b/m4/fts.m4
@@ -1,4 +1,4 @@
-#serial 21
+#serial 22
dnl Copyright (C) 2005-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -28,4 +28,22 @@ AC_DEFUN([gl_FUNC_FTS_CORE],
]])
fi
fi
+
+ AC_CHECK_FUNC([fts_open])
+ if test $ac_cv_func_fts_open = yes; then
+ dnl The system already has the symbols fts_open, etc.
+ dnl Avoid conflicts between these symbols and ours at the linker level.
+ AC_DEFINE([fts_open], [rpl_fts_open],
+ [Define to the overridden function name])
+ AC_DEFINE([fts_close], [rpl_fts_close],
+ [Define to the overridden function name])
+ AC_DEFINE([fts_read], [rpl_fts_read],
+ [Define to the overridden function name])
+ AC_DEFINE([fts_set], [rpl_fts_set],
+ [Define to the overridden function name])
+ AC_DEFINE([fts_children], [rpl_fts_children],
+ [Define to the overridden function name])
+ AC_DEFINE([fts_cross_check], [rpl_fts_cross_check],
+ [Define to the overridden function name])
+ fi
])
diff --git a/tests/test-fts.c b/tests/test-fts.c
index 14d37022c9..4c6bdb6e94 100644
--- a/tests/test-fts.c
+++ b/tests/test-fts.c
@@ -102,7 +102,7 @@ main (void)
/* Create directories BASE, BASE/d, BASE/d/1, BASE/d/2, ..., BASE/d/65536,
to stress-test fts. Stop if directory creation fails due to
- EMFILE problems, or if BASE/d's link count no longer matches the
+ EMFILE or EMLINK problems, or if BASE/d's link count no longer matches the
Unix tradition. See:
https://bugzilla.kernel.org/show_bug.cgi?id=196405
for more info. */
@@ -115,7 +115,9 @@ main (void)
sprintf (buf, "%s/d/%i", base, i);
if (mkdir (buf, 0777) != 0)
{
- if (errno != EMFILE || i <= needles)
+ if (errno == EMFILE || errno == EMLINK)
+ break;
+ if (i <= needles)
perror_exit (buf, 77);
break;
}