getlogin, getlogin_r: Document HP-UX 11.11 bugs.
authorBruno Haible <bruno@clisp.org>
Mon, 20 Dec 2010 11:31:17 +0000 (12:31 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 20 Dec 2010 11:31:17 +0000 (12:31 +0100)
* doc/posix-functions/getlogin.texi: Document HP-UX 11.11 bug.
* doc/posix-functions/getlogin_r.texi: Likewise.
* tests/test-getlogin_r.c (main): Avoid test failure on HP-UX 11.11.

ChangeLog
doc/posix-functions/getlogin.texi
doc/posix-functions/getlogin_r.texi
tests/test-getlogin_r.c

index 385df69..74e93a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-12-20  Bruno Haible  <bruno@clisp.org>
 
+       getlogin, getlogin_r: Document HP-UX 11.11 bugs.
+       * doc/posix-functions/getlogin.texi: Document HP-UX 11.11 bug.
+       * doc/posix-functions/getlogin_r.texi: Likewise.
+       * tests/test-getlogin_r.c (main): Avoid test failure on HP-UX 11.11.
+
+2010-12-20  Bruno Haible  <bruno@clisp.org>
+
        getlogin_r: Add missing declaration on HP-UX 11.
        * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Test whether getlogin_r is
        declared also when it exists as a function.
index dbee598..1f99b63 100644 (file)
@@ -15,4 +15,8 @@ mingw.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+This function returns an empty string even when standard input is a tty
+on some platforms:
+HP-UX 11.11.
 @end itemize
index 83a506f..c162b7d 100644 (file)
@@ -22,4 +22,7 @@ Solaris 11 2010-11 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+This function fails even when standard input is a tty on some platforms:
+HP-UX 11.11.
 @end itemize
index 68c6812..4bd808e 100644 (file)
@@ -35,11 +35,16 @@ main (void)
 {
   /* Test with a large enough buffer.  */
   char buf[1024];
+  int err;
 
-  if (getlogin_r (buf, sizeof (buf)) != 0)
+  err = getlogin_r (buf, sizeof (buf));
+  if (err != 0)
     {
       /* getlogin_r() fails when stdin is not connected to a tty.  */
+      ASSERT (err == ENOTTY);
+#if !defined __hpux /* On HP-UX 11.11 it fails anyway.  */
       ASSERT (! isatty (0));
+#endif
       fprintf (stderr, "Skipping test: stdin is not a tty.\n");
       return 77;
     }