mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-08-24 07:50:59 +02:00
bugfix in check_lockfile() when file is not found
This commit is contained in:
parent
4680342667
commit
e89aed7bb5
@ -1967,6 +1967,8 @@
|
|||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true; // consider the file always locked and skip the test
|
return true; // consider the file always locked and skip the test
|
||||||
@ -2001,11 +2003,15 @@
|
|||||||
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
|
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
|
||||||
error_reporting (DEFAULT_ERROR_LEVEL);
|
error_reporting (DEFAULT_ERROR_LEVEL);
|
||||||
|
|
||||||
if (flock($fp, LOCK_EX)) {
|
if ($fp) {
|
||||||
$stamp = fgets($fp);
|
if (flock($fp, LOCK_EX)) {
|
||||||
flock($fp, LOCK_UN);
|
$stamp = fgets($fp);
|
||||||
fclose($fp);
|
flock($fp, LOCK_UN);
|
||||||
return $stamp;
|
fclose($fp);
|
||||||
|
return $stamp;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user