summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-05-20 17:22:08 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-05-20 17:22:08 +1000
commit62db62669e0df6e05530200142cc753690a2ab5f (patch)
tree53a8d55770057f285ca9788de397bc73647fe8a7 /inc/functions.php
parentd8301964b192c97e04fab81c80d90b2a19c49dc0 (diff)
error handling
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php
index b6b5f16e..6029e68f 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -212,11 +212,12 @@
}
function file_write($path, $data) {
- $fp = fopen($path, 'c');
+ if(!$fp = fopen($path, 'c'))
+ error('Unable to open file for writing: ' . $path);
// File locking
if(!flock($fp, LOCK_EX)) {
- error('Unable to lock file!');
+ error('Unable to lock file: ' . $path);
}
// Truncate file