diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-20 17:50:34 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-20 17:50:34 -0500 |
commit | 17cdd0c1cf0ca6eb2f31c9bf423afeb692acdccc (patch) | |
tree | 8ef926c100cd06b30feecc4a5a111786e3f73f97 /pts-core/functions/pts-functions_system_cpu.php | |
parent | 82fbbacb2bee2874f120d1562976d7dd5339310e (diff) | |
download | phoronix-test-suite-upstream-17cdd0c1cf0ca6eb2f31c9bf423afeb692acdccc.tar.gz phoronix-test-suite-upstream-17cdd0c1cf0ca6eb2f31c9bf423afeb692acdccc.tar.xz phoronix-test-suite-upstream-17cdd0c1cf0ca6eb2f31c9bf423afeb692acdccc.zip |
pts-core: Return false on failure from read_sysctl() instead of
"Unknown" string
Diffstat (limited to 'pts-core/functions/pts-functions_system_cpu.php')
-rw-r--r-- | pts-core/functions/pts-functions_system_cpu.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions_system_cpu.php b/pts-core/functions/pts-functions_system_cpu.php index 1244155..e26538b 100644 --- a/pts-core/functions/pts-functions_system_cpu.php +++ b/pts-core/functions/pts-functions_system_cpu.php @@ -24,6 +24,8 @@ function hw_cpu_core_count() { // Returns number of cores present on the system + $info = null; + if(IS_LINUX) { $processors = read_cpuinfo("processor"); @@ -43,7 +45,8 @@ function hw_cpu_core_count() { $info = read_osx_system_profiler("SPHardwareDataType", "TotalNumberOfCores"); } - else + + if(empty($info)) { $info = 1; } @@ -125,6 +128,11 @@ function hw_cpu_string() else if(IS_BSD) { $info = read_sysctl("hw.model"); + + if(empty($info)) + { + $info = "Unknown"; + } } else if(IS_MACOSX) { |