]> Savannah Git Hosting - gnulib.git/commitdiff
linkat: don't unconditionally replace on GNU/Linux
authorPádraig Brady <P@draigBrady.com>
Fri, 31 Oct 2014 18:18:36 +0000 (18:18 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 3 Nov 2014 14:11:00 +0000 (15:11 +0100)
* m4/linkat.m4 (gl_FUNC_LINKAT): The compile check for AT_SYMLINK_FOLLOW
was redundant for a few reasons.  It was present to support compiling
on new systems but running on the old narrow window of Linux 2.6.1[67].
It setup and cleaned up test files which weren't actually used.
On non __linux__ it compile tested AT_SYMLINK_FOLLOW, but that is
implicit in the following check.

ChangeLog
m4/linkat.m4

index e9d848a611c863d479cb54d7b601a62da9eff2ff..6728893e438d07758b325ae746eb03c11b97dbbc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-11-03  Pádraig Brady  <P@draigBrady.com>
+
+       linkat: don't unconditionally replace on GNU/Linux
+       * m4/linkat.m4 (gl_FUNC_LINKAT): The compile check for AT_SYMLINK_FOLLOW
+       was redundant for a few reasons.  It was present to support compiling
+       on new systems but running on the old narrow window of Linux 2.6.1[67].
+       It setup and cleaned up test files which weren't actually used.
+       On non __linux__ it compile tested AT_SYMLINK_FOLLOW, but that is
+       implicit in the following check.
+
 2014-11-03  Pádraig Brady  <P@draigBrady.com>
 
        linkat: wrap to handle symlinks on OS X 10.10
index a2b5213c16f411569c43119d5701b938e824f16a..fb0277da61cdf02015f681f36515d7e37d0699e2 100644 (file)
@@ -41,24 +41,6 @@ AC_DEFUN([gl_FUNC_LINKAT],
           LINKAT_SYMLINK_NOTSUP=1])
        rm -rf conftest.l1 conftest.l2])
 
-    AC_CACHE_CHECK([whether linkat(,AT_SYMLINK_FOLLOW) works],
-      [gl_cv_func_linkat_follow],
-      [rm -rf conftest.f1 conftest.f2
-       touch conftest.f1
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <fcntl.h>
-#include <unistd.h>
-#ifdef __linux__
-/* Linux added linkat in 2.6.16, but did not add AT_SYMLINK_FOLLOW
-   until 2.6.18.  Always replace linkat to support older kernels.  */
-choke me
-#endif
-]], [return linkat (AT_FDCWD, "conftest.f1", AT_FDCWD, "conftest.f2",
-                    AT_SYMLINK_FOLLOW);])],
-         [gl_cv_func_linkat_follow=yes],
-         [gl_cv_func_linkat_follow="need runtime check"])
-       rm -rf conftest.f1 conftest.f2])
-
     AC_CACHE_CHECK([whether linkat handles trailing slash correctly],
       [gl_cv_func_linkat_slash],
       [rm -rf conftest.a conftest.b conftest.c conftest.d
@@ -108,8 +90,7 @@ choke me
       *)    gl_linkat_slash_bug=1 ;;
     esac
 
-    if test "$gl_cv_func_linkat_follow" != yes \
-       || test "$gl_cv_func_linkat_nofollow" != yes \
+    if test "$gl_cv_func_linkat_nofollow" != yes \
        || test $gl_linkat_slash_bug = 1; then
       REPLACE_LINKAT=1
       AC_DEFINE_UNQUOTED([LINKAT_TRAILING_SLASH_BUG], [$gl_linkat_slash_bug],