changeset 8855:84be2134de13

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.
author Jim Meyering <jim@meyering.net>
date Sun, 20 May 2007 07:33:32 +0000
parents 9473918b3ad6
children 784991232215
files ChangeLog m4/openat.m4
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/m4/openat.m4
+++ b/m4/openat.m4
@@ -37,6 +37,7 @@
      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_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