# HG changeset patch # User Bruno Haible # Date 1316600507 -7200 # Node ID bad19c8ddacb64dc373f8dd1749f277a138c735e # Parent 100f7d4f443de8d7e947c2ef85279622d1d9b5d4 getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC. * tests/test-getlogin.c (main): Allow a failure with EINVAL. * tests/test-getlogin_r.c (main): Likewise. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-21 Bruno Haible + + getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC. + * tests/test-getlogin.c (main): Allow a failure with EINVAL. + * tests/test-getlogin_r.c (main): Likewise. + 2011-09-20 Bruno Haible time tests: Don't require pid_t. diff --git a/tests/test-getlogin.c b/tests/test-getlogin.c --- a/tests/test-getlogin.c +++ b/tests/test-getlogin.c @@ -40,7 +40,9 @@ if (buf == NULL) { /* getlogin() fails when stdin is not connected to a tty. */ - ASSERT (errno == ENOTTY); + ASSERT (errno == ENOTTY + || errno == EINVAL /* seen on Linux/SPARC */ + ); #if !defined __hpux /* On HP-UX 11.11 it fails anyway. */ ASSERT (! isatty (0)); #endif diff --git a/tests/test-getlogin_r.c b/tests/test-getlogin_r.c --- a/tests/test-getlogin_r.c +++ b/tests/test-getlogin_r.c @@ -41,7 +41,9 @@ if (err != 0) { /* getlogin_r() fails when stdin is not connected to a tty. */ - ASSERT (err == ENOTTY); + ASSERT (err == ENOTTY + || errno == EINVAL /* seen on Linux/SPARC */ + ); #if !defined __hpux /* On HP-UX 11.11 it fails anyway. */ ASSERT (! isatty (0)); #endif