From 303b52d25a7e50477e9c67c208737ccfc0de2cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 29 Sep 2024 12:42:29 +0200 Subject: [PATCH] minor improvements to parallelization logic --- src/Concerns/ParallelCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Concerns/ParallelCommand.php b/src/Concerns/ParallelCommand.php index df355929..0807fca3 100644 --- a/src/Concerns/ParallelCommand.php +++ b/src/Concerns/ParallelCommand.php @@ -68,7 +68,7 @@ trait ParallelCommand } // This should return the total number of logical cores on any BSD-based system - if ($ffi->sysctlbyname('hw.ncpu', FFI::addr($cores), FFI::addr($size), null, 0) == -1) { + if ($ffi->sysctlbyname('hw.ncpu', FFI::addr($cores), FFI::addr($size), null, 0) !== 0) { return -1; } @@ -104,7 +104,7 @@ trait ParallelCommand $processes = (int) $processes; } - if ($processes < 0) { // can come from sysctlGetLogicalCoreCount() + if ($processes < 1) { $this->components->error('Minimum value for processes is 1. Try specifying -p manually.'); exit(1); }