Tweak patch that overrides open() and fopen().
authorBruno Haible <bruno@clisp.org>
Sun, 28 Sep 2008 12:59:52 +0000 (14:59 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 28 Sep 2008 12:59:52 +0000 (14:59 +0200)
ChangeLog
doc/posix-functions/freopen.texi
lib/fcntl.in.h
lib/stdio.in.h

index 8a684e5ccc6ffa6da37bd1de8097c44fe0c8fa00..6cec4e972adf2a9054ca016f341643a453345690 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index ccb25eace077c4eb5c7e5492387c384970b72996..150b1aa6b495f80b538988a835c93f81b424339e 100644 (file)
@@ -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
index 82e9b3aa10cc1b218c135b4eed3c38ee94aa94f8..278f2039f4574c2c1c926c5634664be5964c9785 100644 (file)
@@ -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
index ef9558012dbb11d19024f8de14e1333424ad0c3a..695d00f52d38c3d3fb96cc1af03e6e20f6796ee2 100644 (file)
@@ -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