1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 05:55:56 +00:00

make_lockfile: check if file was created successfully

This commit is contained in:
Andrew Dolgov
2013-02-25 21:28:51 +04:00
parent 1a43a68cb1
commit a44bfcfd52

View File

@@ -929,7 +929,7 @@
function make_lockfile($filename) { function make_lockfile($filename) {
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w"); $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')) { if (function_exists('posix_getpid')) {
fwrite($fp, posix_getpid() . "\n"); fwrite($fp, posix_getpid() . "\n");
} }