From 4fd7cdb11eef025a6c83c056cad3f29ed5d3161c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 28 Sep 2008 14:59:52 +0200 Subject: [PATCH] Tweak patch that overrides open() and fopen(). --- ChangeLog | 9 +++++++++ doc/posix-functions/freopen.texi | 5 +++++ lib/fcntl.in.h | 1 + lib/stdio.in.h | 2 ++ 4 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8a684e5cc..6cec4e972 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-09-28 Bruno Haible + * doc/posix-functions/freopen.texi: Mention the trailing slash problem. + + * lib/stdio.in.h (fopen, freopen): Undefine before redefining. Needed + with AIX xlc. + * lib/fcntl.in.h (open): Likewise. + Reported by Rainer Tammer . + +2008-09-28 Bruno Haible + * modules/posix_spawnp-tests: New file. * tests/test-posix_spawn.c: New file. * tests/test-posix_spawn.in.sh: New file. diff --git a/doc/posix-functions/freopen.texi b/doc/posix-functions/freopen.texi index ccb25eace..150b1aa6b 100644 --- a/doc/posix-functions/freopen.texi +++ b/doc/posix-functions/freopen.texi @@ -18,4 +18,9 @@ Portability problems not fixed by Gnulib: @item On Windows platforms (excluding Cygwin), this function does not set @code{errno} upon failure. +@item +This function does not fail when the file name argument ends in a slash +and (without the slash) names a nonexistent file or a file that is not a +directory, on some platforms: +HP-UX 11.00, Solaris 9, Irix 5.3. @end itemize diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 82e9b3aa1..278f2039f 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -38,6 +38,7 @@ extern "C" { #endif #if (@GNULIB_OPEN@ && @REPLACE_OPEN@) || defined FCHDIR_REPLACEMENT +# undef open # define open rpl_open extern int open (const char *filename, int flags, ...); #endif diff --git a/lib/stdio.in.h b/lib/stdio.in.h index ef9558012..695d00f52 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -253,6 +253,7 @@ extern int vsprintf (char *str, const char *format, va_list args) #if @GNULIB_FOPEN@ # if @REPLACE_FOPEN@ +# undef fopen # define fopen rpl_fopen extern FILE * fopen (const char *filename, const char *mode); # endif @@ -266,6 +267,7 @@ extern FILE * fopen (const char *filename, const char *mode); #if @GNULIB_FREOPEN@ # if @REPLACE_FREOPEN@ +# undef freopen # define freopen rpl_freopen extern FILE * freopen (const char *filename, const char *mode, FILE *stream); # endif -- 2.11.0