From d3b08826ea5c33a1a39a7fe12d63d6c4be1f7d1c Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Sat, 21 Oct 2017 11:23:34 -0700 Subject: [PATCH] In case of multiple non-hyperthreaded CPU's, entry for cpu 0 was skipped. This was because code was testing for empty (blank) line like this: if (!$line) continue; but a line consisting of string "0" will also be skipped. Solution: get rid of that line, not needed anyway. --- plugins/dynamix/include/SysDevs.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/dynamix/include/SysDevs.php b/plugins/dynamix/include/SysDevs.php index 819596317..4de2e584c 100644 --- a/plugins/dynamix/include/SysDevs.php +++ b/plugins/dynamix/include/SysDevs.php @@ -37,7 +37,6 @@ case 't2': exec('cat /sys/devices/system/cpu/*/topology/thread_siblings_list|sort -nu',$pairs); $i = 1; foreach ($pairs as $line) { - if (!$line) continue; $line = preg_replace(['/(\d+)[-,](\d+)/','/(\d+)\b/'],['$1 / $2','cpu $1'],$line); echo "".(strpos($line,'/')===false?"Single":"Pair ".$i++).":$line"; } @@ -45,7 +44,6 @@ case 't2': case 't3': exec('lsusb|sort',$lsusb); foreach ($lsusb as $line) { - if (!$line) continue; list($bus,$id) = explode(':', $line, 2); echo "$bus:".trim($id).""; } @@ -53,7 +51,7 @@ case 't3': case 't4': exec('lsscsi -s',$lsscsi); foreach ($lsscsi as $line) { - if (!$line || strpos($line,'/dev/')===false) continue; + if (strpos($line,'/dev/')===false) continue; echo "".preg_replace('/\] +/',']',$line).""; } break;