Fix for high CPU usage caused by "PHP Warning" flooding the journal.

PHP Warning:  fgets() expects parameter 1 to be resource, boolean was given
This commit is contained in:
Justin Theberge
2016-04-05 08:59:03 -04:00
parent 4297718527
commit 096bc06d65

View File

@@ -156,11 +156,12 @@
$file="/etc/pihole/gravity.list";
$linecount = 0;
$handle = fopen($file, "r");
while(!feof($handle)){
if(gettype($handle) == "resource") {
while(!feof($handle)){
$line = fgets($handle);
$linecount++;
}
}
fclose($handle);
return $linecount;