ports/137581: [patch] lzmautils-devel (xz): correct detection of number of processors

Martin Birgmeier martin at email.aon.at
Sat Aug 8 20:00:13 UTC 2009


>Number:         137581
>Category:       ports
>Synopsis:       [patch] lzmautils-devel (xz): correct detection of number of processors
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 08 20:00:12 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Martin Birgmeier
>Release:        FreeBSD 7.2-RELEASE i386
>Organization:
MBi at home
>Environment:
	latest ports

>Description:
	there is a bug in the source code of xz which prevents it from
	correctly detecting the number of processors. patch follows.

>How-To-Repeat:
	run 'xz -H' on a multi-core machine and verify that it always
	reports "one" for the maximum number of threads it will use

>Fix:

------------------------------ snip ------------------------------
--- ./src/xz/hardware.c.ORIG	2008-11-19 15:21:23.000000000 +0100
+++ ./src/xz/hardware.c	2009-08-08 21:13:49.000000000 +0200
@@ -42,7 +42,7 @@
 static void
 hardware_cores(void)
 {
-#if defined(HAVE_NUM_PROCESSORS_SYSCONF)
+#if defined(HAVE_NCPU_SYSCONF)
 	const long cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	if (cpus > 0)
 		opt_threads = (size_t)(cpus);
------------------------------ snip ------------------------------

	This should probably also be reported upstream.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list