summaryrefslogtreecommitdiffstats
path: root/etc/inc/notices.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-07-30 01:47:15 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-07-30 01:47:15 +0000
commit34e1ff97afa807f3220123b9552fd000fcf035e0 (patch)
tree3fec1b6a073aca66f1a796e1b87d68af9ef3eddd /etc/inc/notices.inc
parentd1cfae7b524013d31e94593cf66c3ffb1156c085 (diff)
downloadpfsense-34e1ff97afa807f3220123b9552fd000fcf035e0.zip
pfsense-34e1ff97afa807f3220123b9552fd000fcf035e0.tar.gz
Return and log error when we cannot open a valid write stream
Diffstat (limited to 'etc/inc/notices.inc')
-rw-r--r--etc/inc/notices.inc20
1 files changed, 12 insertions, 8 deletions
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc
index 3549a89..dfff3b3 100644
--- a/etc/inc/notices.inc
+++ b/etc/inc/notices.inc
@@ -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;
}
?> \ No newline at end of file
OpenPOWER on IntegriCloud