summaryrefslogtreecommitdiffstats
path: root/tests/util.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-06-08 16:32:01 -0400
committerTavian Barnes <tavianator@tavianator.com>2025-06-15 10:23:27 -0400
commit38f3e3e7ba210bbc45c2077102c308ed8abae061 (patch)
treeb45afca281216cc833b99311c6e6fd3ddc55d045 /tests/util.sh
parentcb40f51e4e6375a10265484b6959c6b1b0591378 (diff)
downloadbfs-38f3e3e7ba210bbc45c2077102c308ed8abae061.tar.xz
*.sh: Don't shadow the global nproc
This avoids the need for the bash 3 workaround of running command nproc in a subshell.
Diffstat (limited to 'tests/util.sh')
-rw-r--r--tests/util.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/util.sh b/tests/util.sh
index e3eca60..1718a1a 100644
--- a/tests/util.sh
+++ b/tests/util.sh
@@ -194,9 +194,9 @@ pop_defers() {
## Parallelism
# Get the number of processors
-nproc() {
+_nproc() {
{
- (command nproc) \
+ nproc \
|| sysctl -n hw.ncpu \
|| getconf _NPROCESSORS_ONLN \
|| echo 1