From 803d33a3266497f89edd9bfae92875a9afdd0df2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 6 Oct 2006 12:00:23 +0000 Subject: r19125: merge from samba4 (This used to be commit 65e1500ae6b5ca6334a63f4a18272568202bc048) --- source3/lib/replace/repdir.m4 | 45 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'source3/lib/replace/repdir.m4') diff --git a/source3/lib/replace/repdir.m4 b/source3/lib/replace/repdir.m4 index 81025d618a..f53a4c2974 100644 --- a/source3/lib/replace/repdir.m4 +++ b/source3/lib/replace/repdir.m4 @@ -7,28 +7,6 @@ AC_CACHE_CHECK([for broken readdir],libreplace_cv_READDIR_NEEDED,[ [libreplace_cv_READDIR_NEEDED="assuming not"]) ]) -# -# try to replace with getdents() if needed -# -if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then -AC_CHECK_FUNCS(getdents) -AC_CACHE_CHECK([for replacing readdir using getdents()],libreplace_cv_READDIR_GETDENTS,[ - AC_TRY_RUN([ -#define _LIBREPLACE_REPLACE_H -#include "$libreplacedir/repdir_getdents.c" -#define test_readdir_os2_delete main -#include "$libreplacedir/test/os2_delete.c"], - [libreplace_cv_READDIR_GETDENTS=yes], - [libreplace_cv_READDIR_GETDENTS=no]) -]) -fi -if test x"$libreplace_cv_READDIR_GETDENTS" = x"yes"; then - AC_DEFINE(REPLACE_READDIR,1,[replace readdir]) - AC_DEFINE(REPLACE_READDIR_GETDENTS,1,[replace readdir using getdents()]) - LIBREPLACEOBJ="${LIBREPLACEOBJ} repdir_getdents.o" - libreplace_cv_READDIR_NEEDED=no -fi - # # try to replace with getdirentries() if needed # @@ -68,6 +46,29 @@ if test x"$libreplace_cv_READDIR_GETDIRENTRIES" = x"yes"; then libreplace_cv_READDIR_NEEDED=no fi +# +# try to replace with getdents() if needed +# +if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then +AC_CHECK_FUNCS(getdents) +AC_CACHE_CHECK([for replacing readdir using getdents()],libreplace_cv_READDIR_GETDENTS,[ + AC_TRY_RUN([ +#define _LIBREPLACE_REPLACE_H +#error _donot_use_getdents_replacement_anymore +#include "$libreplacedir/repdir_getdents.c" +#define test_readdir_os2_delete main +#include "$libreplacedir/test/os2_delete.c"], + [libreplace_cv_READDIR_GETDENTS=yes], + [libreplace_cv_READDIR_GETDENTS=no]) +]) +fi +if test x"$libreplace_cv_READDIR_GETDENTS" = x"yes"; then + AC_DEFINE(REPLACE_READDIR,1,[replace readdir]) + AC_DEFINE(REPLACE_READDIR_GETDENTS,1,[replace readdir using getdents()]) + LIBREPLACEOBJ="${LIBREPLACEOBJ} repdir_getdents.o" + libreplace_cv_READDIR_NEEDED=no +fi + AC_MSG_CHECKING([a usable readdir()]) if test x"$libreplace_cv_READDIR_NEEDED" = x"yes"; then AC_MSG_RESULT(no) -- cgit