From 395a37e379bf900b2b6a25e17c44cde2d1c46c44 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 15 Jun 2009 21:12:57 -0700 Subject: When iterating over CPU bitmask, don't try more than CPU_SETSIZE. --- posix/tst-cpucount.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'posix') diff --git a/posix/tst-cpucount.c b/posix/tst-cpucount.c index fe3cded732..b3691a18da 100644 --- a/posix/tst-cpucount.c +++ b/posix/tst-cpucount.c @@ -1,5 +1,6 @@ #include #include +#include static int do_test (void) @@ -8,7 +9,7 @@ do_test (void) CPU_ZERO (&c); - for (int cnt = 0; cnt < 130; ++cnt) + for (int cnt = 0; cnt < MIN (CPU_SETSIZE, 130); ++cnt) { int n = CPU_COUNT (&c); if (n != cnt) -- cgit 1.4.1