From: Bruno Haible Date: Sun, 28 Sep 2008 12:59:52 +0000 (+0200) Subject: Tweak patch that overrides open() and fopen(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fd7cdb11eef025a6c83c056cad3f29ed5d3161c;p=pspp Tweak patch that overrides open() and fopen(). --- diff --git a/ChangeLog b/ChangeLog index 8a684e5ccc..6cec4e972a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/doc/posix-functions/freopen.texi b/doc/posix-functions/freopen.texi index ccb25eace0..150b1aa6b4 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 82e9b3aa10..278f2039f4 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 ef9558012d..695d00f52d 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