faccessat, symlinkat: continue cleanup of previous patch
authorEric Blake <ebb9@byu.net>
Mon, 7 Sep 2009 02:53:59 +0000 (20:53 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 7 Sep 2009 02:55:23 +0000 (20:55 -0600)
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Ensure dependency order.
* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Likewise.
* modules/unistd (Makefile.am): Substitute GNULIB_READLINKAT.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Offer GNULIB_READLINKAT.
* modules/symlinkat (configure.ac): Set GNULIB_READLINKAT.
* lib/unistd.in.h (readlinkat): Declare if GNULIB_READLINKAT is
set.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/unistd.in.h
m4/faccessat.m4
m4/symlinkat.m4
m4/unistd_h.m4
modules/symlinkat
modules/unistd

index f587cc4..e5ebf06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-09-06  Eric Blake  <ebb9@byu.net>
+
+       faccessat, symlinkat: continue cleanup of previous patch
+       * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Ensure dependency order.
+       * m4/faccessat.m4 (gl_FUNC_FACCESSAT): Likewise.
+       * modules/unistd (Makefile.am): Substitute GNULIB_READLINKAT.
+       * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Offer GNULIB_READLINKAT.
+       * modules/symlinkat (configure.ac): Set GNULIB_READLINKAT.
+       * lib/unistd.in.h (readlinkat): Declare if GNULIB_READLINKAT is
+       set.
+
 2009-09-06  Bruno Haible  <bruno@clisp.org>
 
        * lib/sys_stat.in.h (fchmodat): Declare if GNULIB_FCHMODAT is set.
index ed25f69..6503529 100644 (file)
@@ -193,15 +193,19 @@ int faccessat (int fd, char const *file, int mode, int flag);
 # if !@HAVE_SYMLINKAT@
 int symlinkat (char const *contents, int fd, char const *file);
 # endif
-# if !@HAVE_READLINKAT@
-ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
-# endif
 #elif defined GNULIB_POSIXCHECK
 # undef symlinkat
 # define symlinkat(c,d,n)                           \
     (GL_LINK_WARNING ("symlinkat is not portable - " \
                       "use gnulib module symlinkat for portability"), \
      symlinkat (c, d, n))
+#endif
+
+#if @GNULIB_READLINKAT@
+# if !@HAVE_READLINKAT@
+ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
+# endif
+#elif defined GNULIB_POSIXCHECK
 # undef readlinkat
 # define readlinkat(d,n,b,l)                        \
     (GL_LINK_WARNING ("faccessat is not portable - " \
index 250d97b..0aa9526 100644 (file)
@@ -1,4 +1,4 @@
-# serial 2
+# serial 3
 # See if we need to provide faccessat replacement.
 
 dnl Copyright (C) 2009 Free Software Foundation, Inc.
@@ -12,6 +12,7 @@ AC_DEFUN([gl_FUNC_FACCESSAT],
 [
   AC_REQUIRE([gl_FUNC_OPENAT])
   AC_REQUIRE([gl_FUNC_EUIDACCESS])
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_FUNCS_ONCE([access])
   AC_CHECK_FUNCS_ONCE([faccessat])
index 50d9954..93980d5 100644 (file)
@@ -1,4 +1,4 @@
-# serial 1
+# serial 2
 # See if we need to provide symlinkat/readlinkat replacement.
 
 dnl Copyright (C) 2009 Free Software Foundation, Inc.
@@ -11,6 +11,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_SYMLINKAT],
 [
   AC_REQUIRE([gl_FUNC_OPENAT])
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_FUNCS_ONCE([symlink symlinkat readlinkat])
   if test $ac_cv_func_symlinkat = no; then
index d9781f7..84f0755 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 23
+# unistd_h.m4 serial 24
 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -55,6 +55,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
   GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
+  GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
   GNULIB_SLEEP=0;            AC_SUBST([GNULIB_SLEEP])
   GNULIB_SYMLINKAT=0;        AC_SUBST([GNULIB_SYMLINKAT])
   GNULIB_UNISTD_H_GETOPT=0;  AC_SUBST([GNULIB_UNISTD_H_GETOPT])
index 7f8506f..2da3ba4 100644 (file)
@@ -15,6 +15,7 @@ unistd
 configure.ac:
 gl_FUNC_SYMLINKAT
 gl_UNISTD_MODULE_INDICATOR([symlinkat])
+gl_UNISTD_MODULE_INDICATOR([readlinkat])
 
 Makefile.am:
 
index fbcb50e..1f8b29e 100644 (file)
@@ -48,6 +48,7 @@ unistd.h: unistd.in.h
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
              -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
              -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
              -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
              -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \