From: Eric Blake Date: Mon, 7 Sep 2009 02:53:59 +0000 (-0600) Subject: faccessat, symlinkat: continue cleanup of previous patch X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa686284617c4695252f39a67c20dee5a28a8408;p=pspp 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index f587cc43d6..e5ebf06cdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-09-06 Eric Blake + + 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 * lib/sys_stat.in.h (fchmodat): Declare if GNULIB_FCHMODAT is set. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index ed25f69bb7..6503529115 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -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 - " \ diff --git a/m4/faccessat.m4 b/m4/faccessat.m4 index 250d97b1ec..0aa95264b6 100644 --- a/m4/faccessat.m4 +++ b/m4/faccessat.m4 @@ -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]) diff --git a/m4/symlinkat.m4 b/m4/symlinkat.m4 index 50d9954cd0..93980d56da 100644 --- a/m4/symlinkat.m4 +++ b/m4/symlinkat.m4 @@ -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 diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index d9781f786d..84f07553e4 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -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]) diff --git a/modules/symlinkat b/modules/symlinkat index 7f8506fb57..2da3ba42fe 100644 --- a/modules/symlinkat +++ b/modules/symlinkat @@ -15,6 +15,7 @@ unistd configure.ac: gl_FUNC_SYMLINKAT gl_UNISTD_MODULE_INDICATOR([symlinkat]) +gl_UNISTD_MODULE_INDICATOR([readlinkat]) Makefile.am: diff --git a/modules/unistd b/modules/unistd index fbcb50e536..1f8b29e506 100644 --- a/modules/unistd +++ b/modules/unistd @@ -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' \