diff options
-rw-r--r-- | configure.in | 25 | ||||
-rw-r--r-- | file_io/unix/dir.c | 7 |
2 files changed, 4 insertions, 28 deletions
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 <sys/types.h> - #include <dirent.h> - ], - [ - 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 diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index b2dd95513..d9b344f30 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -188,10 +188,9 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, ret = APR_ENOENT; } #else - /* We're about to call readdir() that may possibly set errno, and the - * logic below actually cares about errno after the call. Therefore - * we need to clear errno first. - */ + /* We're about to call a non-thread-safe readdir() that may + possibly set `errno', and the logic below actually cares about + errno after the call. Therefore we need to clear errno first. */ errno = 0; thedir->entry = readdir(thedir->dirstruct); if (thedir->entry == NULL) { |