Blame SOURCES/xchat-1.8.7-use-sysconf-to-detect-cpus.patch

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