From d3f4e16f3ccdbcbb9298ac0148e17376bc64350a Mon Sep 17 00:00:00 2001 From: Matthew Wener <125427297+ConstrictM@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:36:40 -0500 Subject: [PATCH] fix(freebsd): fix cpu count for load graph Signed-off-by: Matthew Wener <125427297+ConstrictM@users.noreply.github.com> --- lib/OperatingSystems/FreeBSD.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OperatingSystems/FreeBSD.php b/lib/OperatingSystems/FreeBSD.php index 0b138235..8d99d625 100644 --- a/lib/OperatingSystems/FreeBSD.php +++ b/lib/OperatingSystems/FreeBSD.php @@ -79,8 +79,9 @@ public function getCpuCount(): int { $numCpu = -1; try { - $numCpu = intval($this->executeCommand('sysctl -n hw.ncpu')); //TODO: this should be tested if it actually works on FreeBSD + $numCpu = intval($this->executeCommand('/sbin/sysctl -n hw.ncpu')); } catch (RuntimeException) { + return $numCpu; } return $numCpu;