Skip to content

Commit 2cc5f7c

Browse files
committed
fix HW_NUMA_NODES glob issue
1 parent ec8bce1 commit 2cc5f7c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/lbnl_hw.nhc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ EDAC_MAX_UNCORRECTED="${EDAC_MAX_UNCORRECTED:-0}"
3030

3131
# Read hardware information from /proc and /sys files.
3232
function nhc_hw_gather_data() {
33-
local IFS LINE CORES SIBLINGS MHZ PROCESSOR PHYS_ID PORT INDEX DEV NODES
33+
local IFS LINE CORES SIBLINGS MHZ PROCESSOR PHYS_ID PORT INDEX DEV
3434
local -a FIELD PHYS_IDS IB_PORTS
3535

3636
# Gather CPU info
@@ -74,8 +74,7 @@ function nhc_hw_gather_data() {
7474

7575
# Gather NUMA info
7676
if [[ -d /sys/devices/system/node ]]; then
77-
NODES=(/sys/devices/system/node/node*)
78-
HW_NUMA_NODES=${#NODES[@]}
77+
HW_NUMA_NODES=$(shopt -s nullglob; set -- /sys/devices/system/node/node* ; echo $#)
7978
HW_NUMA_NPS=$((HW_NUMA_NODES/$HW_SOCKETS))
8079
fi
8180
dbg "Got $HW_NUMA_NODES NUMA node(s) (NPS: $HW_NUMA_NPS)"

0 commit comments

Comments
 (0)