|
Packit |
709fb3 |
# closedir.m4 serial 5
|
|
Packit |
709fb3 |
dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
|
|
Packit |
709fb3 |
dnl This file is free software; the Free Software Foundation
|
|
Packit |
709fb3 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit |
709fb3 |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
AC_DEFUN([gl_FUNC_CLOSEDIR],
|
|
Packit |
709fb3 |
[
|
|
Packit |
709fb3 |
AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
|
|
Packit |
709fb3 |
|
|
Packit |
709fb3 |
AC_CHECK_FUNCS([closedir])
|
|
Packit |
709fb3 |
if test $ac_cv_func_closedir = no; then
|
|
Packit |
709fb3 |
HAVE_CLOSEDIR=0
|
|
Packit |
709fb3 |
fi
|
|
Packit |
709fb3 |
dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
|
|
Packit |
709fb3 |
dnl to keep fchdir's bookkeeping up-to-date.
|
|
Packit |
709fb3 |
m4_ifdef([gl_FUNC_FCHDIR], [
|
|
Packit |
709fb3 |
gl_TEST_FCHDIR
|
|
Packit |
709fb3 |
if test $HAVE_FCHDIR = 0; then
|
|
Packit |
709fb3 |
if test $HAVE_CLOSEDIR = 1; then
|
|
Packit |
709fb3 |
REPLACE_CLOSEDIR=1
|
|
Packit |
709fb3 |
fi
|
|
Packit |
709fb3 |
fi
|
|
Packit |
709fb3 |
])
|
|
Packit |
709fb3 |
dnl Replace closedir() for supporting the gnulib-defined dirfd() function.
|
|
Packit |
709fb3 |
case $host_os,$HAVE_CLOSEDIR in
|
|
Packit |
709fb3 |
os2*,1)
|
|
Packit |
709fb3 |
REPLACE_CLOSEDIR=1;;
|
|
Packit |
709fb3 |
esac
|
|
Packit |
709fb3 |
])
|