Work around a HP-UX stdio bug.
authorBruno Haible <bruno@clisp.org>
Sun, 13 Apr 2008 19:41:13 +0000 (21:41 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 13 Apr 2008 19:41:13 +0000 (21:41 +0200)
ChangeLog
doc/posix-functions/ftell.texi
doc/posix-functions/ftello.texi
tests/test-ftell.c
tests/test-ftello.c

index b9b9692fc218cd54dc0dc1b8cac6d92b2cdfa312..46aa92cc7d78a76ad5d2cfc42874e3639b95fb70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 00b5402dc3b84eac7783361dd5919216db657179..a692859eeff488846f972b3cccd3348b06441f42 100644 (file)
@@ -10,6 +10,10 @@ Portability problems fixed by Gnulib:
 @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:
index e78300fb6f593e107e18968fe04cbc33ceafcbfc..ddee6a2bd06935a1afc181f26a329884f47e0b41 100644 (file)
@@ -15,6 +15,10 @@ OSF/1 4.0, Solaris 2.5.1, mingw.
 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
 
index 79af6c56febd4fe2696a0fb674b3efe5403a87f6..092be192d61b33edc15b953a621c16ce2f658478 100644 (file)
@@ -80,9 +80,11 @@ main (int argc, char **argv)
   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 == '~');
index 26c7ab55033022f0c983dde8e53fd61302e4a354..87f4966ae8b76f6378921bdc7f9eb997abec75b0 100644 (file)
@@ -88,10 +88,12 @@ main (int argc, char **argv)
   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 == '~');