summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-06-15 21:12:57 -0700
committerPetr Baudis <pasky@suse.cz>2009-06-16 12:23:11 +0200
commit2a31410e40b61c47ab4c5283c25cea2c5405d757 (patch)
tree64be8a4316b9f00e2f90155df80acaa38301d3f1 /posix
parent3ff6565150bef32e4cfc565b1463df84dd8c6d7a (diff)
When iterating over CPU bitmask, don't try more than CPU_SETSIZE.
(cherry picked from commit 395a37e379bf900b2b6a25e17c44cde2d1c46c44)
Diffstat (limited to 'posix')
-rw-r--r--posix/tst-cpucount.c3
1 files changed, 2 insertions, 1 deletions
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 <sched.h>
#include <stdio.h>
+#include <sys/param.h>
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)