1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 21:15:55 +00:00

new config option: LOCK_DIRECTORY (bump config version)

This commit is contained in:
Andrew Dolgov
2008-01-17 06:33:52 +01:00
parent e3b9d084d4
commit cfa43e025c
5 changed files with 12 additions and 8 deletions

View File

@@ -1857,7 +1857,7 @@
function file_is_locked($filename) {
if (function_exists('flock')) {
error_reporting(0);
$fp = fopen($filename, "r");
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
error_reporting(DEFAULT_ERROR_LEVEL);
if ($fp) {
if (flock($fp, LOCK_EX | LOCK_NB)) {
@@ -1873,7 +1873,7 @@
}
function make_lockfile($filename) {
$fp = fopen($filename, "w");
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
if (flock($fp, LOCK_EX | LOCK_NB)) {
return $fp;
@@ -1883,7 +1883,7 @@
}
function make_stampfile($filename) {
$fp = fopen($filename, "w");
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
if (flock($fp, LOCK_EX | LOCK_NB)) {
fwrite($fp, time() . "\n");
@@ -1898,7 +1898,7 @@
function read_stampfile($filename) {
error_reporting(0);
$fp = fopen($filename, "r");
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
error_reporting (DEFAULT_ERROR_LEVEL);
if (flock($fp, LOCK_EX)) {