From: Andrew Dolgov Date: Mon, 25 Feb 2013 17:28:51 +0000 (+0400) Subject: make_lockfile: check if file was created successfully X-Git-Tag: 1.7.1~42 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a44bfcfd529439c2ac05d0f300fd241b54a24af3;p=tt-rss.git make_lockfile: check if file was created successfully --- diff --git a/include/functions.php b/include/functions.php index 2b7b7c58..72d86e0a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -929,7 +929,7 @@ function make_lockfile($filename) { $fp = fopen(LOCK_DIRECTORY . "/$filename", "w"); - if (flock($fp, LOCK_EX | LOCK_NB)) { + if ($fp && flock($fp, LOCK_EX | LOCK_NB)) { if (function_exists('posix_getpid')) { fwrite($fp, posix_getpid() . "\n"); }