summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-06-07 09:39:12 +0400
committerAndrew Dolgov <[email protected]>2013-06-07 09:39:12 +0400
commit58fc7095edfddc76100aacf6fb22dd6527c8a739 (patch)
tree414d2f2e426892017b6e8a6783887e336e3255f3 /include
parent0f9067450afce685918ba0edc0cbd621545ee060 (diff)
make_lockfile: check ino and dev fields for lock file (refs #703)
Diffstat (limited to 'include')
-rw-r--r--include/functions.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php
index 2f288737e..87917a5cb 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -992,6 +992,13 @@
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
if ($fp && flock($fp, LOCK_EX | LOCK_NB)) {
+ $stat_h = fstat($fp);
+ $stat_f = stat(LOCK_DIRECTORY . "/$filename");
+
+ if ($stat_h["ino"] != $stat_f["ino"] || $stat_h["dev"] != $stat_f["dev"]) {
+ return false;
+ }
+
if (function_exists('posix_getpid')) {
fwrite($fp, posix_getpid() . "\n");
}