1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Fix ./bin/package host cpu on FreeBSD (#99)

This bugfix is from Marcin Cieślak's fork of the INIT build
system. Before this bugfix, running 'bin/package host cpu'
on FreeBSD would always report one CPU core, even if the CPU
is multi-core:

$ ./bin/package host cpu
1

bin/package,
src/cmd/INIT/package.sh:
- Correctly report the number of CPUs on FreeBSD by using
  'sysctl -n hw.ncpu'.
This commit is contained in:
Johnothan King 2020-07-27 05:23:42 -07:00 committed by GitHub
parent 81f3a6294a
commit af9c2144b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -1673,6 +1673,13 @@ hostinfo() # attribute ...
continue
;;
esac
cpu=`sysctl -n hw.ncpu`
case $cpu in
[123456789]*)
_hostinfo_="$_hostinfo_ $cpu"
continue
;;
esac
cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo`
case $cpu in
[123456789]*)

View file

@ -1672,6 +1672,13 @@ hostinfo() # attribute ...
continue
;;
esac
cpu=`sysctl -n hw.ncpu`
case $cpu in
[123456789]*)
_hostinfo_="$_hostinfo_ $cpu"
continue
;;
esac
cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo`
case $cpu in
[123456789]*)