make_lockfile: check ino and dev fields for lock file (refs #703)
This commit is contained in:
parent
0f9067450a
commit
58fc7095ed
1 changed files with 7 additions and 0 deletions
|
@ -992,6 +992,13 @@
|
||||||
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
|
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
|
||||||
|
|
||||||
if ($fp && flock($fp, LOCK_EX | LOCK_NB)) {
|
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')) {
|
if (function_exists('posix_getpid')) {
|
||||||
fwrite($fp, posix_getpid() . "\n");
|
fwrite($fp, posix_getpid() . "\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue