Skip to content

Commit

Permalink
better sysctl use if it's not in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Rys Sommefeldt authored and mpapis committed Mar 31, 2013
1 parent b286cee commit e77f34e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion scripts/functions/build_config
Expand Up @@ -370,7 +370,21 @@ __rvm_detect_max_threads()
{
case "$(uname)" in
(Darwin|FreeBSD)
sysctl -n hw.ncpu
if
__rvm_which sysctl >/dev/null
then
sysctl -n hw.ncpu
elif
[[ -x /usr/sbin/sysctl ]]
then
/usr/sbin/sysctl -n hw.ncpu
elif
[[ -x /sbin/sysctl ]]
then
/sbin/sysctl -n hw.ncpu
else
echo 1
fi
;;
(*)
cat /proc/cpuinfo 2>/dev/null | (grep vendor_id || echo 'one';) | wc -l
Expand Down

0 comments on commit e77f34e

Please sign in to comment.