summaryrefslogtreecommitdiffstats
path: root/system/libraries/Output.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Output.php')
-rw-r--r--system/libraries/Output.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/system/libraries/Output.php b/system/libraries/Output.php
index 781e368cb..98a941af5 100644
--- a/system/libraries/Output.php
+++ b/system/libraries/Output.php
@@ -389,9 +389,16 @@ class CI_Output {
$expire = time() + ($this->cache_expiration * 60);
- flock($fp, LOCK_EX);
- fwrite($fp, $expire.'TS--->'.$output);
- flock($fp, LOCK_UN);
+ if (flock($fp, LOCK_EX))
+ {
+ fwrite($fp, $expire.'TS--->'.$output);
+ flock($fp, LOCK_UN);
+ }
+ else
+ {
+ log_message('error', "Unable to secure a file lock for file at: ".$cache_path);
+ return;
+ }
fclose($fp);
@chmod($cache_path, DIR_WRITE_MODE);