changeset 13965:9cc6c6504486

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.
author Bruno Haible <bruno@clisp.org>
date Mon, 20 Dec 2010 12:31:17 +0100
parents 4375e072858f
children cd5c217f15be
files ChangeLog doc/posix-functions/getlogin.texi doc/posix-functions/getlogin_r.texi tests/test-getlogin_r.c
diffstat 4 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
--- a/doc/posix-functions/getlogin.texi
+++ b/doc/posix-functions/getlogin.texi
@@ -15,4 +15,8 @@
 
 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
--- a/doc/posix-functions/getlogin_r.texi
+++ b/doc/posix-functions/getlogin_r.texi
@@ -22,4 +22,7 @@
 
 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
--- a/tests/test-getlogin_r.c
+++ b/tests/test-getlogin_r.c
@@ -35,11 +35,16 @@
 {
   /* 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;
     }