mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 23:45:55 +00:00
file_is_locked: check if file exists before trying to flock it
This commit is contained in:
@@ -961,7 +961,7 @@
|
||||
}
|
||||
|
||||
function file_is_locked($filename) {
|
||||
if (function_exists('flock')) {
|
||||
if (function_exists('flock') && file_exists(LOCK_DIRECTORY . "/$filename")) {
|
||||
$fp = @fopen(LOCK_DIRECTORY . "/$filename", "r");
|
||||
if ($fp) {
|
||||
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
||||
|
||||
Reference in New Issue
Block a user