changeset 9915:3dadfbdbc21a

Work around a HP-UX stdio bug.
author Bruno Haible <bruno@clisp.org>
date Sun, 13 Apr 2008 21:41:13 +0200
parents 682e19d65658
children 3826b3abb5d0
files ChangeLog doc/posix-functions/ftell.texi doc/posix-functions/ftello.texi tests/test-ftell.c tests/test-ftello.c
diffstat 5 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Apr 13 21:20:17 2008 +0200
+++ b/ChangeLog	Sun Apr 13 21:41:13 2008 +0200
@@ -1,3 +1,11 @@
+2008-04-13  Bruno Haible  <bruno@clisp.org>
+
+	Work around a HP-UX stdio bug.
+	* tests/test-ftell.c (main): Disable the fseek/ftell test on HP-UX.
+	* tests/test-ftello.c (main): Likewise.
+	* doc/posix-functions/ftell.texi: Mention HP-UX bug.
+	* doc/posix-functions/ftello.texi: Likewise.
+
 2008-04-13  Bruno Haible  <bruno@clisp.org>
 
 	Make test-signbit pass on HP-UX/hppa.
--- a/doc/posix-functions/ftell.texi	Sun Apr 13 21:20:17 2008 +0200
+++ b/doc/posix-functions/ftell.texi	Sun Apr 13 21:41:13 2008 +0200
@@ -10,6 +10,10 @@
 @itemize
 @item
 This function mistakenly succeeds on pipes on some platforms: mingw.
+@item
+This function produces incorrect results immediately after @code{fseek} on some
+platforms:
+HP-UX 11.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/doc/posix-functions/ftello.texi	Sun Apr 13 21:20:17 2008 +0200
+++ b/doc/posix-functions/ftello.texi	Sun Apr 13 21:41:13 2008 +0200
@@ -15,6 +15,10 @@
 The declaration of @code{ftello} in @code{<stdio.h>} is not enabled by default
 on some platforms: glibc 2.3.6.
 @item
+This function produces incorrect results immediately after @code{fseek} on some
+platforms:
+HP-UX 11.
+@item
 This function fails on seekable stdin, stdout, and stderr: cygwin <= 1.5.24.
 @end itemize
 
--- a/tests/test-ftell.c	Sun Apr 13 21:20:17 2008 +0200
+++ b/tests/test-ftell.c	Sun Apr 13 21:41:13 2008 +0200
@@ -80,9 +80,11 @@
   ASSERT (ch == '@');
   ASSERT (ftell (stdin) == 3);
 
+#if !defined __hpux /* HP-UX 11 has a known bug here */
   /* Test ftell after ungetc without read.  */
   ASSERT (fseek (stdin, 0, SEEK_CUR) == 0);
   ASSERT (ftell (stdin) == 3);
+#endif
 
   ch = ungetc ('~', stdin);
   ASSERT (ch == '~');
--- a/tests/test-ftello.c	Sun Apr 13 21:20:17 2008 +0200
+++ b/tests/test-ftello.c	Sun Apr 13 21:41:13 2008 +0200
@@ -88,10 +88,12 @@
   ASSERT (ftell (stdin) == 3);
   ASSERT (ftello (stdin) == 3);
 
+#if !defined __hpux /* HP-UX 11 has a known bug here */
   /* Test ftell after ungetc without read.  */
   ASSERT (fseek (stdin, 0, SEEK_CUR) == 0);
   ASSERT (ftell (stdin) == 3);
   ASSERT (ftello (stdin) == 3);
+#endif
 
   ch = ungetc ('~', stdin);
   ASSERT (ch == '~');