file_is_locked: check if file exists before trying to flock it
This commit is contained in:
parent
2a7362596f
commit
1d76589693
1 changed files with 1 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue