diff options
author | Andrew Dolgov <[email protected]> | 2013-05-28 15:58:03 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-05-28 15:58:03 +0400 |
commit | 1d7658969352ee73dd94baf3cea15364dd303786 (patch) | |
tree | 557cb839d6dc8d181902336bc7807490f1215746 /include | |
parent | 2a7362596f5ffcf6c5fad98f0e188eb3e9c2d466 (diff) |
file_is_locked: check if file exists before trying to flock it
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php index 7db040d04..01ffa751f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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)) { |