diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-20 17:45:45 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-11-20 17:45:45 -0500 |
commit | 82fbbacb2bee2874f120d1562976d7dd5339310e (patch) | |
tree | 1db8ebd86b062bb189ad072faf6a870a65694ea2 /pts-core/functions/pts-functions_system_software.php | |
parent | a4c22653687fdc9a835089f4b35c193f9669827e (diff) | |
download | phoronix-test-suite-upstream-82fbbacb2bee2874f120d1562976d7dd5339310e.tar.gz phoronix-test-suite-upstream-82fbbacb2bee2874f120d1562976d7dd5339310e.tar.xz phoronix-test-suite-upstream-82fbbacb2bee2874f120d1562976d7dd5339310e.zip |
pts-core: Return false on failure from read_lsb() instead of "Unknown"
string
Diffstat (limited to 'pts-core/functions/pts-functions_system_software.php')
-rw-r--r-- | pts-core/functions/pts-functions_system_software.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pts-core/functions/pts-functions_system_software.php b/pts-core/functions/pts-functions_system_software.php index 4cfb86b..e034991 100644 --- a/pts-core/functions/pts-functions_system_software.php +++ b/pts-core/functions/pts-functions_system_software.php @@ -129,7 +129,14 @@ function sw_os_kernel() function sw_os_vendor() { // Returns OS vendor - return read_lsb("Distributor ID"); + $vendor = read_lsb("Distributor ID"); + + if(empty($vendor)) + { + $vendor = "Unknown"; + } + + return $vendor; } function sw_os_version() { @@ -147,6 +154,11 @@ function sw_os_version() $os_version = substr($os, $start_pos + 1, $end_pos - $start_pos); } + + if(empty($os_version)) + { + $os_version = "Unknown"; + } return $os_version; |