(legacy) fix for crashreport ....failed to open stream: No such file or directory in /usr/local/www/guiconfig.inc on line 361

This commit is contained in:
Ad Schellevis 2015-09-30 18:11:23 +00:00
parent 7c39adf71a
commit 287b34d6c8

View File

@ -358,10 +358,12 @@ function clear_log($logfile, $restart_syslogd = true)
}
/* preserve file ownership and permissions */
$handle = fopen($logfile, 'r+');
if ($handle) {
ftruncate($handle, 0);
fclose($handle);
if (file_exists($logfile)) {
$handle = fopen($logfile, 'r+');
if ($handle) {
ftruncate($handle, 0);
fclose($handle);
}
}
if ($restart_syslogd) {