mirror of git://sourceware.org/git/glibc.git
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>
This commit is contained in:
parent
3cc0cd4c5b
commit
1214ec8f4c
|
|
@ -1,3 +1,8 @@
|
||||||
|
2012-06-04 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/tst-getcpu.c (do_test): Call perror when
|
||||||
|
cpu2 is -1 and errno is not ENOSYS.
|
||||||
|
|
||||||
2012-06-04 H.J. Lu <hongjiu.lu@intel.com>
|
2012-06-04 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
[BZ #14117]
|
[BZ #14117]
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,16 @@ do_test (void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int cpu2 = sched_getcpu ();
|
int cpu2 = sched_getcpu ();
|
||||||
if (cpu2 == -1 && errno == ENOSYS)
|
if (cpu2 == -1)
|
||||||
|
{
|
||||||
|
if (errno == ENOSYS)
|
||||||
{
|
{
|
||||||
puts ("getcpu syscall not implemented");
|
puts ("getcpu syscall not implemented");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
perror ("getcpu failed");
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
if (cpu2 != cpu)
|
if (cpu2 != cpu)
|
||||||
{
|
{
|
||||||
printf ("getcpu results %d not possible\n", cpu2);
|
printf ("getcpu results %d not possible\n", cpu2);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue