From 1181e9874237fdebb9ed6b71cc184fbc6b5a6f3d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 1 Apr 2019 17:37:16 +0000 Subject: Revert r1789258, r1856189, r1856191 following discussion on list, in favor of a simpler path of avoiding dirread_r always, by default. This saves us various additional detection logic, and follows advice of library maintainers and our library's behavior, any apparent "thread safety" offered by the _r() flavors of this function were not truly supported by APR's allocation or dirread_r reentrancy of parallel threads attemping to access the same open directory descriptor. Retains r1856192, r1856196 to avoid wasteful allocation in the dirread() case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1856755 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 959a55846..a55106977 100644 --- a/configure.in +++ b/configure.in @@ -845,31 +845,8 @@ ac_cv_define_GETSERVBYNAME_IS_THREAD_SAFE=no if test "$threads" = "1"; then AC_MSG_NOTICE([APR will use threads]) AC_CHECK_LIB(c_r, readdir, - apr_readdir_is_thread_safe=yes) - if test "x$apr_readdir_is_thread_safe" = "x"; then - AC_CHECK_HEADERS(dirent.h) - AC_CHECK_FUNCS(readdir_r) - APR_IFALLYES(header:dirent.h func:readdir_r, - apr_has_readdir_r="1", apr_has_readdir_r="0") - if test "$apr_has_readdir_r" = "1"; then - dnl readdir_r() may exist but be deprecated, meaning - dnl the readdir() itself is thread-safe - APR_TRY_COMPILE_NO_WARNING([ - #include - #include - ], - [ - DIR *dir = opendir("/tmp"); - struct dirent entry, *result; - return readdir_r(dir, &entry, &result) != 0; - ], apr_readdir_is_thread_safe=no, apr_readdir_is_thread_safe=yes) - fi - fi - if test "$apr_readdir_is_thread_safe" = "yes"; then - AC_MSG_NOTICE([APR will use thread-safe readdir()]) AC_DEFINE(READDIR_IS_THREAD_SAFE, 1, - [Define if readdir is thread safe]) - fi + [Define if readdir is thread safe])) if test "x$apr_gethostbyname_is_thread_safe" = "x"; then AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes) fi -- cgit v1.2.1