mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 13:45:56 +00:00
make_lockfile: check ino and dev fields for lock file (refs #703)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user