From: Bruno Haible Date: Mon, 20 Dec 2010 11:31:17 +0000 (+0100) Subject: getlogin, getlogin_r: Document HP-UX 11.11 bugs. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12f12a9c5b08fb25c6212f37a62b218f4b5bb5a8;p=pspp 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. --- diff --git a/ChangeLog b/ChangeLog index 385df69568..74e93a346e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/doc/posix-functions/getlogin.texi b/doc/posix-functions/getlogin.texi index dbee598431..1f99b63b6f 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 83a506ff4b..c162b7dd60 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 68c681232b..4bd808e5b1 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; }