summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-02-25 21:28:51 +0400
committerAndrew Dolgov <[email protected]>2013-02-25 21:28:51 +0400
commita44bfcfd529439c2ac05d0f300fd241b54a24af3 (patch)
tree5aaf85bc48a4aac613eb90848ce83b740796ed2c
parent1a43a68cb107205d43fee40a1d71cc998d6abc74 (diff)
make_lockfile: check if file was created successfully
-rw-r--r--include/functions.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php
index 2b7b7c586..72d86e0a7 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -929,7 +929,7 @@
function make_lockfile($filename) {
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
- if (flock($fp, LOCK_EX | LOCK_NB)) {
+ if ($fp && flock($fp, LOCK_EX | LOCK_NB)) {
if (function_exists('posix_getpid')) {
fwrite($fp, posix_getpid() . "\n");
}