summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-28 14:22:03 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-28 14:22:03 +0200
commit0357ecfc68c734384ea890929085c04605204666 (patch)
treef6534764434eba41b38321283cf8872e7e384a3e /src
parenta60c1700498cb18c5198247c82650cc99c29641d (diff)
downloadpfsense-0357ecfc68c734384ea890929085c04605204666.zip
pfsense-0357ecfc68c734384ea890929085c04605204666.tar.gz
Declare the harddisks variable only if needed
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/system.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 94ef368..f7987e1 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -2042,10 +2042,6 @@ function system_dmesg_save() {
function system_set_harddisk_standby() {
global $g, $config;
- // Get only suitable candidates for standby; using get_smart_drive_list()
- // from utils.inc to get the list of drives.
- $harddisks = array();
- $harddisks = get_smart_drive_list();
if (isset($config['system']['developerspew'])) {
$mt = microtime();
@@ -2060,6 +2056,10 @@ function system_set_harddisk_standby() {
$standby = $config['system']['harddiskstandby'];
// Check for a numeric value
if (is_numeric($standby)) {
+ // Get only suitable candidates for standby; using get_smart_drive_list()
+ // from utils.inc to get the list of drives.
+ $harddisks = get_smart_drive_list();
+
// Since get_smart_drive_list() only matches ad|da|ada; lets put the check below
// just in case of some weird pfSense platform installs.
if (count($harddisks) > 0) {
OpenPOWER on IntegriCloud