mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-12-05 04:51:18 +01:00
file_is_locked: check if file exists before trying to flock it
This commit is contained in:
parent
2a7362596f
commit
1d76589693
@ -961,7 +961,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function file_is_locked($filename) {
|
function file_is_locked($filename) {
|
||||||
if (function_exists('flock')) {
|
if (function_exists('flock') && file_exists(LOCK_DIRECTORY . "/$filename")) {
|
||||||
$fp = @fopen(LOCK_DIRECTORY . "/$filename", "r");
|
$fp = @fopen(LOCK_DIRECTORY . "/$filename", "r");
|
||||||
if ($fp) {
|
if ($fp) {
|
||||||
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user