mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Return and log error when we cannot open a valid write stream
This commit is contained in:
parent
d1cfae7b52
commit
34e1ff97af
@ -57,9 +57,13 @@ function file_notice($id, $notice, $category = "General", $url = "", $priority =
|
||||
);
|
||||
$queue[$queuekey] = $toqueue;
|
||||
$queueout = fopen($notice_path, "w");
|
||||
if(!$queueout) {
|
||||
log_error("Could not open {$notice_path} for writing");
|
||||
return;
|
||||
}
|
||||
fwrite($queueout, serialize($queue));
|
||||
fclose($queueout);
|
||||
log_error("New alert found: {$notice}");
|
||||
log_error("notice", "New alert found: {$notice}");
|
||||
return $queuekey;
|
||||
}
|
||||
|
||||
@ -163,13 +167,13 @@ function print_notice_box($category = "all") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function are_notices_pending($category = "all") {
|
||||
global $notice_path;
|
||||
if(file_exists($notice_path)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
function are_notices_pending($category = "all") {
|
||||
global $notice_path;
|
||||
if(file_exists($notice_path)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user