getlogin, getlogin_r: Document HP-UX 11.11 bugs.
authorBruno Haible <bruno@clisp.org>
Mon, 20 Dec 2010 11:43:41 +0000 (12:43 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 20 Dec 2010 11:43:41 +0000 (12:43 +0100)
* tests/test-getlogin.c: Include <errno.h>.
(main): Avoid test failure on HP-UX 11.11.

ChangeLog
tests/test-getlogin.c

index 74e93a3..f14e940 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,9 @@
        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.
+       * tests/test-getlogin.c: Include <errno.h>.
+       (main): Avoid test failure on HP-UX 11.11.
+       * tests/test-getlogin_r.c (main): Likewise.
 
 2010-12-20  Bruno Haible  <bruno@clisp.org>
 
index 1365108..9b84acb 100644 (file)
@@ -23,6 +23,7 @@
 #include "signature.h"
 SIGNATURE_CHECK (getlogin, char *, (void));
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -39,7 +40,10 @@ main (void)
   if (buf == NULL)
     {
       /* getlogin() fails when stdin is not connected to a tty.  */
+      ASSERT (errno == 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;
     }