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 8a684e5..6cec4e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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.
        * tests/test-posix_spawn.c: New file.
        * tests/test-posix_spawn.in.sh: New file.
index ccb25ea..150b1aa 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 82e9b3a..278f203 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 ef95580..695d00f 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