net-mgmt/ocsinventory-agent: Fix cpu detection

Fix typo, NBSOCKETS isn't defined

Reported by:		Carlos Fernando Assis Paniago
Tested by:		Carlos Fernando Assis Paniago
This commit is contained in:
Mikael Urankar 2024-11-12 15:37:27 +01:00
parent 566a18d032
commit 854533b697
2 changed files with 14 additions and 0 deletions

View file

@ -1,6 +1,7 @@
PORTNAME= ocsinventory PORTNAME= ocsinventory
PORTVERSION= 2.10.4 PORTVERSION= 2.10.4
DISTVERSIONPREFIX= v DISTVERSIONPREFIX= v
PORTREVISION= 1
PORTEPOCH= 1 PORTEPOCH= 1
CATEGORIES= net-mgmt CATEGORIES= net-mgmt
PKGNAMESUFFIX= -agent PKGNAMESUFFIX= -agent

View file

@ -0,0 +1,13 @@
--- lib/Ocsinventory/Agent/Backend/OS/BSD/CPU.pm.orig 2024-11-12 14:35:48 UTC
+++ lib/Ocsinventory/Agent/Backend/OS/BSD/CPU.pm
@@ -64,8 +64,8 @@ sub run {
if ($cpu->{NBSOCKET} and $cpu->{CORES} and $cpu->{THREADS} ){
if ($cpu->{THREADS} >= $cpu->{CORES}) {
$cpu->{THREADS}=$cpu->{THREADS}/$cpu->{CORES};
- } elsif ($cpu->{THREADS} >= $cpu->{NBSOCKETS}) {
- $cpu->{THREADS}=$cpu->{THREADS}/$cpu->{NBSOCKETS};
+ } elsif ($cpu->{THREADS} >= $cpu->{NBSOCKET}) {
+ $cpu->{THREADS}=$cpu->{THREADS}/$cpu->{NBSOCKET};
}
}