From 12f12a9c5b08fb25c6212f37a62b218f4b5bb5a8 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 20 Dec 2010 12:31:17 +0100 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ doc/posix-functions/getlogin.texi | 4 ++++ doc/posix-functions/getlogin_r.texi | 3 +++ tests/test-getlogin_r.c | 7 ++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 385df6956..74e93a346 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-12-20 Bruno Haible + 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 + 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. diff --git a/doc/posix-functions/getlogin.texi b/doc/posix-functions/getlogin.texi index dbee59843..1f99b63b6 100644 --- a/doc/posix-functions/getlogin.texi +++ b/doc/posix-functions/getlogin.texi @@ -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 diff --git a/doc/posix-functions/getlogin_r.texi b/doc/posix-functions/getlogin_r.texi index 83a506ff4..c162b7dd6 100644 --- a/doc/posix-functions/getlogin_r.texi +++ b/doc/posix-functions/getlogin_r.texi @@ -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 diff --git a/tests/test-getlogin_r.c b/tests/test-getlogin_r.c index 68c681232..4bd808e5b 100644 --- a/tests/test-getlogin_r.c +++ b/tests/test-getlogin_r.c @@ -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; } -- 2.11.0