diff --git a/formatcode.sh b/formatcode.sh index 87a54785ec9d535ce6e40a5e19a745907e6cdc06..f585bc2b34971f049c922e188af05c55be113408 100755 --- a/formatcode.sh +++ b/formatcode.sh @@ -14,10 +14,8 @@ set -o nounset # Get CPU count OS=$(uname) NPROC=1 -if [[ $OS = "Linux" ]] ; then - NPROC=$(nproc) -elif [[ ${OS} = "Darwin" ]] ; then - NPROC=$(sysctl -n hw.physicalcpu) +if [[ $OS = "Linux" || $OS = "Darwin" ]] ; then + NPROC=$(getconf _NPROCESSORS_ONLN) fi # Discover clang-format