From e135441c120410c222891af756b35e079ba579b1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 13 Apr 2008 21:41:13 +0200 Subject: [PATCH] Work around a HP-UX stdio bug. --- ChangeLog | 8 ++++++++ doc/posix-functions/ftell.texi | 4 ++++ doc/posix-functions/ftello.texi | 4 ++++ tests/test-ftell.c | 2 ++ tests/test-ftello.c | 2 ++ 5 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index b9b9692fc..46aa92cc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-04-13 Bruno Haible + 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 + Make test-signbit pass on HP-UX/hppa. * tests/test-signbit.c (minus_zerol): New variable. (test_signbitl): Use it. diff --git a/doc/posix-functions/ftell.texi b/doc/posix-functions/ftell.texi index 00b5402dc..a692859ee 100644 --- a/doc/posix-functions/ftell.texi +++ b/doc/posix-functions/ftell.texi @@ -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: diff --git a/doc/posix-functions/ftello.texi b/doc/posix-functions/ftello.texi index e78300fb6..ddee6a2bd 100644 --- a/doc/posix-functions/ftello.texi +++ b/doc/posix-functions/ftello.texi @@ -15,6 +15,10 @@ OSF/1 4.0, Solaris 2.5.1, mingw. The declaration of @code{ftello} in @code{} 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 diff --git a/tests/test-ftell.c b/tests/test-ftell.c index 79af6c56f..092be192d 100644 --- a/tests/test-ftell.c +++ b/tests/test-ftell.c @@ -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 == '~'); diff --git a/tests/test-ftello.c b/tests/test-ftello.c index 26c7ab550..87f4966ae 100644 --- a/tests/test-ftello.c +++ b/tests/test-ftello.c @@ -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 == '~'); -- 2.11.0