From cded3d983ba2d3e0c76bc1c721c78333fa31b385 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Oct 2008 12:43:15 +0200 Subject: [PATCH] Move the euidaccess() declaration to . --- ChangeLog | 18 ++++++++++++++++++ NEWS | 3 +++ lib/euidaccess.c | 3 +-- lib/euidaccess.h | 3 --- lib/unistd.in.h | 15 +++++++++++++++ m4/euidaccess.m4 | 8 +++++--- m4/unistd_h.m4 | 2 ++ modules/euidaccess | 5 +++-- modules/unistd | 2 ++ 9 files changed, 49 insertions(+), 10 deletions(-) delete mode 100644 lib/euidaccess.h diff --git a/ChangeLog b/ChangeLog index 21dbe3cc9..703b63f90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2008-10-18 Bruno Haible + Move the euidaccess() declaration to . + * lib/euidaccess.h: Remove file. + * lib/unistd.in.h (euidaccess): New declaration. + * lib/euidaccess.c: Don't include euidaccess.h. + * m4/euidaccess.m4 (gl_FUNC_EUIDACCESS): Require gl_UNISTD_H_DEFAULTS. + Don't check whether euidaccess is declared. Set HAVE_EUIDACCESS. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_EUIDACCESS + and HAVE_EUIDACCESS. + * modules/euidaccess (Files): Remove lib/euidaccess.h. + (Depends-on): Add unistd. + (configure.ac): Invoke gl_UNISTD_MODULE_INDICATOR. + (Include): Specify instead of euidaccess.h. + * modules/unistd (Makefile.am): Substitute GNULIB_EUIDACCESS and + HAVE_EUIDACCESS. + * NEWS: Mention the change. + +2008-10-18 Bruno Haible + * lib/xgetdomainname.c: Include instead of getdomainname.h. Move the getdomainname() declaration to . diff --git a/NEWS b/NEWS index 16569825c..f9a5ad174 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ User visible incompatible changes Date Modules Changes +2008-10-18 euidaccess The include file is changed from "euidaccess.h" + to . + 2008-10-18 getdomainname The include file is changed from "getdomainname.h" to . diff --git a/lib/euidaccess.c b/lib/euidaccess.c index 9db7bb4f2..17eb72497 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -1,6 +1,6 @@ /* euidaccess -- check if effective user id can access file - Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005, 2006 + Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -23,7 +23,6 @@ #ifndef _LIBC # include -# include "euidaccess.h" #endif #include diff --git a/lib/euidaccess.h b/lib/euidaccess.h deleted file mode 100644 index 17b7e9813..000000000 --- a/lib/euidaccess.h +++ /dev/null @@ -1,3 +0,0 @@ -#if ! HAVE_DECL_EUIDACCESS -int euidaccess (char const *file, int mode); -#endif diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 7a7983a90..a73a201ad 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -134,6 +134,21 @@ extern char **environ; #endif +#if @GNULIB_EUIDACCESS@ +# if !@HAVE_EUIDACCESS@ +/* Like access(), except that is uses the effective user id and group id of + the current process. */ +extern int euidaccess (const char *filename, int mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# define euidaccess(f,m) \ + (GL_LINK_WARNING ("euidaccess is unportable - " \ + "use gnulib module euidaccess for portability"), \ + euidaccess (f, m)) +#endif + + #if @GNULIB_FCHDIR@ # if @REPLACE_FCHDIR@ diff --git a/m4/euidaccess.m4 b/m4/euidaccess.m4 index 7690a1431..6dd49c313 100644 --- a/m4/euidaccess.m4 +++ b/m4/euidaccess.m4 @@ -1,5 +1,5 @@ -# euidaccess.m4 serial 8 -dnl Copyright (C) 2002-2007 Free Software Foundation, Inc. +# euidaccess.m4 serial 9 +dnl Copyright (C) 2002-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,12 +17,14 @@ AC_DEFUN([gl_FUNC_NONREENTRANT_EUIDACCESS], AC_DEFUN([gl_FUNC_EUIDACCESS], [ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl Persuade glibc to declare euidaccess(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_DECLS_ONCE([euidaccess]) AC_REPLACE_FUNCS(euidaccess) if test $ac_cv_func_euidaccess = no; then + HAVE_EUIDACCESS=0 gl_PREREQ_EUIDACCESS fi ]) diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index b9da779f3..b4a60559e 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -36,6 +36,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) @@ -52,6 +53,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) diff --git a/modules/euidaccess b/modules/euidaccess index d1bd3e13d..47d9716e2 100644 --- a/modules/euidaccess +++ b/modules/euidaccess @@ -2,22 +2,23 @@ Description: euidaccess() function: check effective user's permissions for a file. Files: -lib/euidaccess.h lib/euidaccess.c m4/euidaccess.m4 Depends-on: +unistd extensions group-member sys_stat configure.ac: gl_FUNC_EUIDACCESS +gl_UNISTD_MODULE_INDICATOR([euidaccess]) Makefile.am: Include: -"euidaccess.h" + Link: $(LIB_EACCESS) diff --git a/modules/unistd b/modules/unistd index a5a5b791d..182219053 100644 --- a/modules/unistd +++ b/modules/unistd @@ -28,6 +28,7 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ @@ -43,6 +44,7 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ -- 2.11.0