summaryrefslogtreecommitdiff
path: root/lib/fstatat.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-09-02 17:14:26 -0600
committerEric Blake <ebb9@byu.net>2009-09-03 21:20:42 -0600
commit52c658e92436e7ef2d7c7b6f7ee69ae4431b6d7d (patch)
tree768b730735ced1d0d0230b4fefe7b4fcc1e26097 /lib/fstatat.c
parent9de26050ef8a950fd62ebadeeab2eb7505631028 (diff)
downloadgnulib-52c658e92436e7ef2d7c7b6f7ee69ae4431b6d7d.tar.gz
openat: declare in POSIX headers
* NEWS: Mention this. * modules/openat (configure.ac): Declare witnesses. (Depends-on): Add fcntl-h, sys_stat, unistd. (Include): Mention correct headers. * modules/fcntl-h (Depends-on): Add link-warning. (Files): Add openat.m4. (Makefile.am): Substitute witnesses. * modules/sys_stat (Files, Makefile.am): Likewise. * modules/unistd (Files, Makefile.am): Likewise. * m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses. (gl_OPENAT_DEFAULTS): New macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. (SYS_STAT_H): Remove unused variable. * doc/posix-headers/fcntl.texi (fcntl.h): Update content. * lib/fcntl--.h (includes): Remove unneeded header. * lib/openat-safer.c (includes): Likewise. * lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to appropriate headers. (__OPENAT_PREFIX): Delete. * lib/fcntl.in.h (openat): Provide declaration. (AT_FDCWD): Fix Solaris bug. (AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros. * lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration. * lib/fchmodat.c (includes): Adjust to find declaration. * lib/fchownat.c (includes): Likewise. * lib/mkdirat.c (includes): Likewise. * lib/fstatat.c (includes): Likewise. Ensure original fstatat is still visible. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/fstatat.c')
-rw-r--r--lib/fstatat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/fstatat.c b/lib/fstatat.c
index 8b6291225f..2bf547e51b 100644
--- a/lib/fstatat.c
+++ b/lib/fstatat.c
@@ -1,6 +1,6 @@
/* Work around an fstatat bug on Solaris 9.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,12 +19,13 @@
#include <config.h>
-#define COMPILING_FSTATAT 1
-#include "openat.h"
+#include <sys/stat.h>
#include <errno.h>
#include <string.h>
+#undef fstatat
+
/* fstatat should always follow symbolic links that end in /, but on
Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified. This is
the same problem that lstat.c addresses, so solve it in a similar