Mercurial > hg > octave-nkf > gnulib-hg
changeset 17677:4ffedeebd641
fchdir: port 'open' and 'close' redefinitions to AIX 7.1
* lib/chown.c, lib/clean-temp.c, lib/copy-file.c, lib/execute.c:
* lib/fsusage.c, lib/gc-gnulib.c, lib/javacomp.c, lib/mountlist.c:
* lib/openat-proc.c, lib/pagealign_alloc.c, lib/progreloc.c:
* lib/spawn-pipe.c:
Do not #undef 'open' and 'close'. AIX 7 does '#define open open64'
and then 'int open64(const char *, int, ...);', which means the
declaration for 'open' gets lost if we later '#undef open'.
Discovered while building grep pretest 2.18.151-1c770 on AIX 7.1,
where the compilation reported the non-fatal error "In function
'openat_proc_name' ... warning: implicit declaration of function
'open'". In this case the error is relatively harmless, but in
other cases it might not be so minor.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 22 May 2014 00:05:01 -0700 |
parents | 6449329e1063 |
children | c25d6a669147 |
files | ChangeLog lib/chown.c lib/clean-temp.c lib/copy-file.c lib/execute.c lib/fsusage.c lib/gc-gnulib.c lib/javacomp.c lib/mountlist.c lib/openat-proc.c lib/pagealign_alloc.c lib/progreloc.c lib/spawn-pipe.c |
diffstat | 13 files changed, 16 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2014-05-21 Paul Eggert <eggert@cs.ucla.edu> + + fchdir: port 'open' and 'close' redefinitions to AIX 7.1 + * lib/chown.c, lib/clean-temp.c, lib/copy-file.c, lib/execute.c: + * lib/fsusage.c, lib/gc-gnulib.c, lib/javacomp.c, lib/mountlist.c: + * lib/openat-proc.c, lib/pagealign_alloc.c, lib/progreloc.c: + * lib/spawn-pipe.c: + Do not #undef 'open' and 'close'. AIX 7 does '#define open open64' + and then 'int open64(const char *, int, ...);', which means the + declaration for 'open' gets lost if we later '#undef open'. + Discovered while building grep pretest 2.18.151-1c770 on AIX 7.1, + where the compilation reported the non-fatal error "In function + 'openat_proc_name' ... warning: implicit declaration of function + 'open'". In this case the error is relatively harmless, but in + other cases it might not be so minor. + 2014-05-20 Paul Eggert <eggert@cs.ucla.edu> xalloc: don't potentially generate invalid code for xmemdup calls
--- a/lib/chown.c +++ b/lib/chown.c @@ -45,11 +45,6 @@ /* Below we refer to the system's chown(). */ # undef chown -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -# undef open -# undef close - /* Provide a more-closely POSIX-conforming version of chown on systems with one or both of the following problems: - chown doesn't treat an ID of -1 as meaning
--- a/lib/clean-temp.c +++ b/lib/clean-temp.c @@ -69,13 +69,6 @@ # define uintptr_t unsigned long #endif -#if !GNULIB_FCNTL_SAFER -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -# undef open -# undef close -#endif - /* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5)) ensure that while constructing or modifying the data structures, the field
--- a/lib/copy-file.c +++ b/lib/copy-file.c @@ -48,11 +48,6 @@ #define _(str) gettext (str) -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - enum { IO_SIZE = 32 * 1024 }; int
--- a/lib/execute.c +++ b/lib/execute.c @@ -48,11 +48,6 @@ #endif -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - #if defined EINTR && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
--- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -55,11 +55,6 @@ # include "full-read.h" #endif -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - /* Many space usage primitives use all 1 bits to denote a value that is not applicable or unknown. Propagate this information by returning a uintmax_t value that is all 1 bits if X is all 1 bits, even if X
--- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -66,11 +66,6 @@ # include "rijndael-api-fst.h" #endif -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - #ifdef GNULIB_GC_RANDOM # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # include <windows.h>
--- a/lib/javacomp.c +++ b/lib/javacomp.c @@ -51,11 +51,6 @@ #define _(str) gettext (str) -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - /* Survey of Java compilers.
--- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -143,11 +143,6 @@ # include "unlocked-io.h" #endif -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - /* The results of opendir() in this file are not used with dirfd and fchdir, therefore save some unnecessary work in fchdir.c. */ #undef opendir
--- a/lib/openat-proc.c +++ b/lib/openat-proc.c @@ -32,14 +32,6 @@ #include "intprops.h" -/* The results of open() in this file are not used with fchdir, - and we do not leak fds to any single-threaded code that could use stdio, - therefore save some unnecessary work in fchdir.c. - FIXME - if the kernel ever adds support for multi-thread safety for - avoiding standard fds, then we should use open_safer. */ -#undef open -#undef close - #define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s" #define PROC_SELF_FD_NAME_SIZE_BOUND(len) \
--- a/lib/pagealign_alloc.c +++ b/lib/pagealign_alloc.c @@ -48,11 +48,6 @@ # endif #endif -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - #if HAVE_MMAP || ! HAVE_POSIX_MEMALIGN
--- a/lib/progreloc.c +++ b/lib/progreloc.c @@ -89,11 +89,6 @@ # define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif -/* The results of open() in this file are not used with fchdir, - therefore save some unnecessary work in fchdir.c. */ -#undef open -#undef close - /* Use the system functions, not the gnulib overrides in this file. */ #undef sprintf