aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/tst-getcpu.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-06 18:30:15 -0400
committerMike Frysinger <vapier@gentoo.org>2012-06-04 22:22:02 -0400
commit1214ec8f4c2e8fd105a6d9159b85cf31c0c6c386 (patch)
treeb1f3024081995e6628b4ec1037086a086a7e9928 /sysdeps/unix/sysv/linux/tst-getcpu.c
parent3cc0cd4c5b3bed6f7d9aff26322d505785e11aa9 (diff)
downloadglibc-1214ec8f4c2e8fd105a6d9159b85cf31c0c6c386.tar
glibc-1214ec8f4c2e8fd105a6d9159b85cf31c0c6c386.tar.gz
glibc-1214ec8f4c2e8fd105a6d9159b85cf31c0c6c386.tar.bz2
glibc-1214ec8f4c2e8fd105a6d9159b85cf31c0c6c386.zip
tst-getcpu: decode errno when sched_getcpu fails
The tst-getcpu test is failing on ia64 platforms due to sched_getcpu returning an error. But the current test only considers -1 when it's also ENOSYS. Tweak the logic a bit to make the output clearer. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-getcpu.c')
-rw-r--r--sysdeps/unix/sysv/linux/tst-getcpu.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-getcpu.c b/sysdeps/unix/sysv/linux/tst-getcpu.c
index bf3cb57dd8..77baebc0a8 100644
--- a/sysdeps/unix/sysv/linux/tst-getcpu.c
+++ b/sysdeps/unix/sysv/linux/tst-getcpu.c
@@ -31,10 +31,15 @@ do_test (void)
else
{
int cpu2 = sched_getcpu ();
- if (cpu2 == -1 && errno == ENOSYS)
+ if (cpu2 == -1)
{
- puts ("getcpu syscall not implemented");
- return 0;
+ if (errno == ENOSYS)
+ {
+ puts ("getcpu syscall not implemented");
+ return 0;
+ }
+ perror ("getcpu failed");
+ result = 1;
}
if (cpu2 != cpu)
{