--- src/common/util.c.use-sysconf-to-detect-cpus Tue Feb 5 07:44:27 2002
+++ src/common/util.c Tue Feb 5 07:45:59 2002
@@ -399,14 +399,11 @@
int fh;
*mhz = 0;
- *cpus = 0;
+ *cpus = (int) sysconf(_SC_NPROCESSORS_ONLN);
fh = open ("/proc/cpuinfo", O_RDONLY); /* linux 2.2+ only */
if (fh == -1)
- {
- *cpus = 1;
return;
- }
while (1)
{
@@ -421,15 +418,9 @@
} else if (!strncmp (buf, "clock\t\t:", 8)) /* PPC */
{
*mhz = atoi (buf + 9);
- } else if (!strncmp (buf, "processor\t", 10))
- {
- (*cpus)++;
}
}
close (fh);
- if (!*cpus)
- *cpus = 1;
-
#endif
#ifdef USING_FREEBSD