Fix buggy test for the fchownat-deref bug.
authorJim Meyering <jim@meyering.net>
Sun, 20 May 2007 07:33:32 +0000 (07:33 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 20 May 2007 07:33:32 +0000 (07:33 +0000)
* m4/openat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Create the dangling
symlink required for the run-test.  Without it, this test would
always declare that fchownat doesn't work, and client code would
unnecessarily use the replacement function with fixed libc.
(gl_FUNC_FCHOWNAT): Eliminate a variable that wasn't initialized.
Reported by Greg Schafer.

ChangeLog
m4/openat.m4

index c2803fa..611a09a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-05-20  Jim Meyering  <jim@meyering.net>
+
+       Fix buggy test for the fchownat-deref bug.
+       * m4/openat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Create the dangling
+       symlink required for the run-test.  Without it, this test would
+       always declare that fchownat doesn't work, and client code would
+       unnecessarily use the replacement function with fixed libc.
+       (gl_FUNC_FCHOWNAT): Eliminate a variable that wasn't initialized.
+       Reported by Greg Schafer.
+
 2007-05-19  Bruno Haible  <bruno@clisp.org>
 
        * m4/isnanf.m4 (gl_ISNANF_WORKS): New macro.
index 3075057..43f46d0 100644 (file)
@@ -37,6 +37,7 @@ AC_DEFUN([gl_FUNC_FCHOWNAT_DEREF_BUG],
      rm -f $gl_dangle
      # Arrange for deletion of the temporary file this test creates.
      ac_clean_files="$ac_clean_files $gl_dangle"
+     ln -s conftest.no-such $gl_dangle
      AC_RUN_IFELSE(
        [AC_LANG_SOURCE(
          [[
@@ -73,10 +74,7 @@ AC_DEFUN([gl_FUNC_FCHOWNAT],
 
   AC_CHECK_FUNC([fchownat], [have_fchownat=yes], [have_fchownat=no])
   if test $have_fchownat = yes; then
-    gl_FUNC_FCHOWNAT_DEREF_BUG([have_fchownat_bug=yes])
-    if test $have_fchownat_bug = no; then
-      use_replacement_fchownat=no
-    fi
+    gl_FUNC_FCHOWNAT_DEREF_BUG([], [use_replacement_fchownat=no])
   fi
 
   if test $use_replacement_fchownat = yes; then