From 6fe87bef894e5b110b2c1d495dd2bb0c8efa07ad Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 21 Sep 2011 12:21:47 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ tests/test-getlogin.c | 4 +++- tests/test-getlogin_r.c | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4050de539..f03898566 100644 --- 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 index 294a88ef7..2033702fc 100644 --- a/tests/test-getlogin.c +++ b/tests/test-getlogin.c @@ -40,7 +40,9 @@ main (void) 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 index 2a20fd920..bbb58a322 100644 --- a/tests/test-getlogin_r.c +++ b/tests/test-getlogin_r.c @@ -41,7 +41,9 @@ main (void) 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 -- 2.11.0