- # Assume we'll use the replacement function.
- # The only case in which we won't is when we have fchownat, and it works.
- use_replacement_fchownat=yes
-
- AC_CHECK_FUNC([fchownat], [have_fchownat=yes], [have_fchownat=no])
- if test $have_fchownat = yes; then
- gl_FUNC_FCHOWNAT_DEREF_BUG([], [use_replacement_fchownat=no])
+ AC_REQUIRE([gl_FUNC_CHOWN])
+ AC_CHECK_FUNC([fchownat],
+ [gl_FUNC_FCHOWNAT_DEREF_BUG([REPLACE_FCHOWNAT=1
+ AC_DEFINE([FCHOWNAT_NOFOLLOW_BUG], [1], [Define to 1 if your
+ platform has fchownat, but it cannot perform lchown tasks.])])],
+ [HAVE_FCHOWNAT=0])
+ if test $REPLACE_CHOWN = 1; then
+ REPLACE_FCHOWNAT=1