]> Savannah Git Hosting - gnulib.git/commitdiff
fchdir: port 'open' and 'close' redefinitions to AIX 7.1
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 May 2014 07:05:01 +0000 (00:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 May 2014 07:06:33 +0000 (00:06 -0700)
* 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.

13 files changed:
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

index 488a0dad5724517fa167cc906978f8d05f0875ba..35ddc055ddce0288dda5e6d62356d5f80d4917d7 100644 (file)
--- 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
index 15038416be05e8c3c87caf2a50333577f648f2e2..691cebe47f77b024c2f7c5766175f9ee744e76ce 100644 (file)
@@ -45,11 +45,6 @@ chown (const char *file _GL_UNUSED, uid_t uid _GL_UNUSED,
 /* 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
index 5e400d51660b1387b10bc799c838efd1fb20b7cd..057700a670f0cf4587567f0e70d9321cff19e3d7 100644 (file)
 # 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
index 04d518df5a6ea7c98bf30a8a1594a468790ab2a9..488cc94c1c8ff7de35fd0021f7d1d460ca6b7a8b 100644 (file)
 
 #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
index e7b449630985f4dcc8b7e71522c3e99bedc9ffa8..15a487b833cf58f740cd78e52b17af2a20552a11 100644 (file)
 
 #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__)
 
index 6b8f7424d9bb53f92455d9142d64d9653641ed92..5bfc9cd092edf047bf59c38182601243f1771c96 100644 (file)
 # 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
index 573cc9815a435829737cf3857965a9ab9d125d1f..dcd368b2113aeeb5f8be7eb65e08464e0cb3b836 100644 (file)
 # 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>
index 6a15f10eb207184581da8ec53b39071ef1de1482..f54fb59d03929666a4e6d87f78bea17a198634da 100644 (file)
 
 #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.
 
index d59c9937f5d38d2ac239f11bb175ab6e5c3fa855..78af951818e251a96443c3f963d31fa4eaab4942 100644 (file)
 # 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
index 6a4f6ad1cf1e36b4b5c798abe1c11fbd0ad1ba4f..7b40bb8f059a7c98071d1780e9b31e87c51bfa71 100644 (file)
 
 #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) \
index 94a85fcf9ba256b70c4e73d7b8d92136f5abe759..f7fa825f1bec15809df4f4565e0d969dfa555c48 100644 (file)
 # 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
 
index dcfe3099364d1f2bdc57471cbba41258aed17c80..3d7b6a902625775cea0ed2814d7cc7fdf952afee 100644 (file)
@@ -89,11 +89,6 @@ extern char * canonicalize_file_name (const char *name);
 # 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
 
index b3f9e0c11cdeaea4d7687873c43421769f1a0c4c..656980dd840658a60ffaea6da892bca1ff69a5ab 100644 (file)
 
 #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 EINTR