Date: Sat, 8 Aug 2009 21:25:41 +0200 (CEST) From: Martin Birgmeier <martin@email.aon.at> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/137581: [patch] lzmautils-devel (xz): correct detection of number of processors Message-ID: <200908081925.n78JPfZc097303@gandalf.xyzzy> Resent-Message-ID: <200908082000.n78K0CjO004423@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908081925.n78JPfZc097303>