From: binhdvo Date: Mon, 29 Nov 2021 19:11:39 +0000 (-0500) Subject: Fix build for cygwin/bsd (#2882) X-Git-Tag: v1.5.1~1^2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e17363751974dc1ad10785deb4170b23bee0ec;p=thirdparty%2Fzstd.git Fix build for cygwin/bsd (#2882) --- diff --git a/programs/util.c b/programs/util.c index 82363c39a..d69b72a37 100644 --- a/programs/util.c +++ b/programs/util.c @@ -1359,11 +1359,11 @@ int UTIL_countCores(int logical) * see: man 3 sysconf */ int UTIL_countCores(int logical) { - /* suppress unused parameter warning */ - (void) logical; - static int numCores = 0; + /* suppress unused parameter warning */ + (void)logical; + if (numCores != 0) return numCores; numCores = (int)sysconf(_SC_NPROCESSORS_ONLN);