file_is_locked: check if file exists before trying to flock it

master
Andrew Dolgov 11 years ago
parent 2a7362596f
commit 1d76589693

@ -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…
Cancel
Save