From: Andrew Dolgov Date: Tue, 28 May 2013 11:58:03 +0000 (+0400) Subject: file_is_locked: check if file exists before trying to flock it X-Git-Tag: 1.8~60 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1d7658969352ee73dd94baf3cea15364dd303786;p=tt-rss.git file_is_locked: check if file exists before trying to flock it --- diff --git a/include/functions.php b/include/functions.php index 7db040d0..01ffa751 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)) {