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

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