changeset 30219:07394e5955a0

Tweak patch that overrides open() and fopen().
author Bruno Haible <bruno@clisp.org>
date Sun, 28 Sep 2008 14:59:52 +0200
parents 925eac7cfcec
children b7630b904ebd
files ChangeLog doc/posix-functions/freopen.texi lib/fcntl.in.h lib/stdio.in.h
diffstat 4 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Sep 28 14:14:31 2008 +0200
+++ b/ChangeLog	Sun Sep 28 14:59:52 2008 +0200
@@ -1,3 +1,12 @@
+2008-09-28  Bruno Haible  <bruno@clisp.org>
+
+	* 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 <tammer@tammer.net>.
+
 2008-09-28  Bruno Haible  <bruno@clisp.org>
 
 	* modules/posix_spawnp-tests: New file.
--- a/doc/posix-functions/freopen.texi	Sun Sep 28 14:14:31 2008 +0200
+++ b/doc/posix-functions/freopen.texi	Sun Sep 28 14:59:52 2008 +0200
@@ -18,4 +18,9 @@
 @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
--- a/lib/fcntl.in.h	Sun Sep 28 14:14:31 2008 +0200
+++ b/lib/fcntl.in.h	Sun Sep 28 14:59:52 2008 +0200
@@ -38,6 +38,7 @@
 #endif
 
 #if (@GNULIB_OPEN@ && @REPLACE_OPEN@) || defined FCHDIR_REPLACEMENT
+# undef open
 # define open rpl_open
 extern int open (const char *filename, int flags, ...);
 #endif
--- a/lib/stdio.in.h	Sun Sep 28 14:14:31 2008 +0200
+++ b/lib/stdio.in.h	Sun Sep 28 14:59:52 2008 +0200
@@ -253,6 +253,7 @@
 
 #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 @@
 
 #if @GNULIB_FREOPEN@
 # if @REPLACE_FREOPEN@
+#  undef freopen
 #  define freopen rpl_freopen
 extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
 # endif