Mercurial > hg > octave-nkf > gnulib-hg
changeset 12028:a65ac3b41872
openat: simplify use of at-func.c
* lib/at-func.c (includes): Include prerequisites here, to
simplify requirements on client files.
* lib/openat-priv.h: Add double-inclusion guard.
* lib/faccessat.c (includes): Simplify.
* lib/fchmodat.c (includes): Likewise.
* lib/fchownat.c (includes): Likewise.
* lib/mkdirat.c (includes): Likewise.
* lib/mkfifoat.c (includes): Likewise.
* lib/symlinkat.c (includes): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Sat, 19 Sep 2009 08:03:45 -0600 |
parents | b10ac4488b07 |
children | a00b18ad8d1a |
files | ChangeLog lib/at-func.c lib/faccessat.c lib/fchmodat.c lib/fchownat.c lib/mkdirat.c lib/mkfifoat.c lib/openat-priv.h lib/symlinkat.c |
diffstat | 9 files changed, 22 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2009-09-19 Eric Blake <ebb9@byu.net> + openat: simplify use of at-func.c + * lib/at-func.c (includes): Include prerequisites here, to + simplify requirements on client files. + * lib/openat-priv.h: Add double-inclusion guard. + * lib/faccessat.c (includes): Simplify. + * lib/fchmodat.c (includes): Likewise. + * lib/fchownat.c (includes): Likewise. + * lib/mkdirat.c (includes): Likewise. + * lib/mkfifoat.c (includes): Likewise. + * lib/symlinkat.c (includes): Likewise. + openat: allow return of fd 0 * modules/chdir-long (Depends-on): Relax openat-safer to openat. * modules/save-cwd (Depends-on): Replace fcntl-safer with
--- a/lib/at-func.c +++ b/lib/at-func.c @@ -16,6 +16,11 @@ /* written by Jim Meyering */ +#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "openat.h" +#include "openat-priv.h" +#include "save-cwd.h" + #ifdef AT_FUNC_USE_F1_COND # define CALL_FUNC(F) \ (flag == AT_FUNC_USE_F1_COND \
--- a/lib/faccessat.c +++ b/lib/faccessat.c @@ -20,11 +20,6 @@ #include <unistd.h> -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "openat.h" -#include "openat-priv.h" -#include "save-cwd.h" - #ifndef HAVE_ACCESS /* Mingw lacks access, but it also lacks real vs. effective ids, so the gnulib euidaccess module is good enough. */
--- a/lib/fchmodat.c +++ b/lib/fchmodat.c @@ -20,10 +20,7 @@ #include <sys/stat.h> -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "openat.h" -#include "openat-priv.h" -#include "save-cwd.h" +#include <errno.h> #ifndef HAVE_LCHMOD /* Use a different name, to avoid conflicting with any
--- a/lib/fchownat.c +++ b/lib/fchownat.c @@ -25,11 +25,6 @@ #include <unistd.h> -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "openat.h" -#include "openat-priv.h" -#include "save-cwd.h" - /* Replacement for Solaris' function by the same name. Invoke chown or lchown on file, FILE, using OWNER and GROUP, in the directory open on descriptor FD. If FLAG is AT_SYMLINK_NOFOLLOW, then
--- a/lib/mkdirat.c +++ b/lib/mkdirat.c @@ -20,11 +20,6 @@ #include <unistd.h> -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "openat.h" -#include "openat-priv.h" -#include "save-cwd.h" - /* Solaris 10 has no function like this. Create a subdirectory, FILE, with mode MODE, in the directory open on descriptor FD. If possible, do it without changing the
--- a/lib/mkfifoat.c +++ b/lib/mkfifoat.c @@ -20,11 +20,6 @@ #include <sys/stat.h> -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "openat.h" -#include "openat-priv.h" -#include "save-cwd.h" - #ifndef HAVE_MKFIFO # define HAVE_MKFIFO 0 #endif
--- a/lib/openat-priv.h +++ b/lib/openat-priv.h @@ -17,6 +17,9 @@ /* written by Jim Meyering */ +#ifndef _GL_HEADER_OPENAT_PRIV +#define _GL_HEADER_OPENAT_PRIV + #include <errno.h> #include <stdlib.h> @@ -32,3 +35,5 @@ || (Errno) == EPERM || (Errno) == EACCES \ || (Errno) == ENOSYS /* Solaris 8 */ \ || (Errno) == EOPNOTSUPP /* FreeBSD */) + +#endif /* _GL_HEADER_OPENAT_PRIV */
--- a/lib/symlinkat.c +++ b/lib/symlinkat.c @@ -20,11 +20,6 @@ #include <unistd.h> -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ -#include "openat.h" -#include "openat-priv.h" -#include "save-cwd.h" - #if !HAVE_SYMLINK /* Mingw lacks symlink, so this wrapper is trivial. */