diff options
Diffstat (limited to 'm4/fdopendir.m4')
| -rw-r--r-- | m4/fdopendir.m4 | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/m4/fdopendir.m4 b/m4/fdopendir.m4 index d9cc1a00173..9937a74ea8d 100644 --- a/m4/fdopendir.m4 +++ b/m4/fdopendir.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # serial 12 | 1 | # serial 14 |
| 2 | # See if we need to provide fdopendir. | 2 | # See if we need to provide fdopendir. |
| 3 | 3 | ||
| 4 | dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. | 4 | dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. |
| @@ -25,10 +25,12 @@ AC_DEFUN([gl_FUNC_FDOPENDIR], | |||
| 25 | else | 25 | else |
| 26 | AC_CACHE_CHECK([whether fdopendir works], | 26 | AC_CACHE_CHECK([whether fdopendir works], |
| 27 | [gl_cv_func_fdopendir_works], | 27 | [gl_cv_func_fdopendir_works], |
| 28 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | 28 | [AC_RUN_IFELSE( |
| 29 | [AC_LANG_PROGRAM([[ | ||
| 29 | #include <dirent.h> | 30 | #include <dirent.h> |
| 30 | #include <fcntl.h> | 31 | #include <fcntl.h> |
| 31 | #include <unistd.h> | 32 | #include <unistd.h> |
| 33 | ]GL_MDA_DEFINES[ | ||
| 32 | #if !HAVE_DECL_FDOPENDIR | 34 | #if !HAVE_DECL_FDOPENDIR |
| 33 | extern | 35 | extern |
| 34 | # ifdef __cplusplus | 36 | # ifdef __cplusplus |
| @@ -36,12 +38,14 @@ extern | |||
| 36 | # endif | 38 | # endif |
| 37 | DIR *fdopendir (int); | 39 | DIR *fdopendir (int); |
| 38 | #endif | 40 | #endif |
| 39 | ]], [int result = 0; | 41 | ]], |
| 40 | int fd = open ("conftest.c", O_RDONLY); | 42 | [[int result = 0; |
| 41 | if (fd < 0) result |= 1; | 43 | int fd = open ("conftest.c", O_RDONLY); |
| 42 | if (fdopendir (fd)) result |= 2; | 44 | if (fd < 0) result |= 1; |
| 43 | if (close (fd)) result |= 4; | 45 | if (fdopendir (fd)) result |= 2; |
| 44 | return result;])], | 46 | if (close (fd)) result |= 4; |
| 47 | return result; | ||
| 48 | ]])], | ||
| 45 | [gl_cv_func_fdopendir_works=yes], | 49 | [gl_cv_func_fdopendir_works=yes], |
| 46 | [gl_cv_func_fdopendir_works=no], | 50 | [gl_cv_func_fdopendir_works=no], |
| 47 | [case "$host_os" in | 51 | [case "$host_os" in |