summaryrefslogtreecommitdiff
path: root/x86info.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2009-12-11 12:42:41 -0500
committerDave Jones <davej@redhat.com>2009-12-11 12:42:41 -0500
commit0817ae893516bd29289da4e5d614538b9810781d (patch)
treede65cffffb4f1b065de869060413f4b9e6d1d8cb /x86info.c
parent99c162a97904043844131092b13d2007bcffa14e (diff)
Handle non-sequential socket numbers correctly.
Diffstat (limited to 'x86info.c')
-rw-r--r--x86info.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/x86info.c b/x86info.c
index b2f469e..ce86aa1 100644
--- a/x86info.c
+++ b/x86info.c
@@ -394,11 +394,10 @@ int main (int argc, char **argv)
}
for (i=0; i<nrCPUs; i++) {
- if (sockets[i]==0)
- break;
if (debug == 1)
printf("Socket %d: %d threads\n", i, sockets[i]);
- num_sockets++;
+ if (sockets[i] != 0) /* only count populated sockets */
+ num_sockets++;
}
/* Print a summary */