bugfix in check_lockfile() when file is not found

This commit is contained in:
Andrew Dolgov 2008-04-25 05:52:48 +01:00
parent 4680342667
commit e89aed7bb5

View File

@ -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,6 +2003,7 @@
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r"); $fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
error_reporting (DEFAULT_ERROR_LEVEL); error_reporting (DEFAULT_ERROR_LEVEL);
if ($fp) {
if (flock($fp, LOCK_EX)) { if (flock($fp, LOCK_EX)) {
$stamp = fgets($fp); $stamp = fgets($fp);
flock($fp, LOCK_UN); flock($fp, LOCK_UN);
@ -2009,6 +2012,9 @@
} else { } else {
return false; return false;
} }
} else {
return false;
}
} }
function sql_random_function() { function sql_random_function() {