Skip to content

Commit d508b5d

Browse files
Merge branch '4.0' into 4.1
* 4.0: [Lock] use 'r+' for fopen (fixes issue on Solaris) [HttpKernel] fix test compat with PHP 5.3 fix handling of nested Error instances fix file lock on SunOS [Cache] more granular handling of exceptions in AbstractTrait::clear() change `evaluate()` docblock return type from string to mixed Set serialize_precision explicitly to avoid fancy float rounding
2 parents 275a3f9 + fa8421a commit d508b5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Store/FlockStore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ private function lock(Key $key, $blocking)
7979

8080
// Silence error reporting
8181
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
82-
if (!$handle = fopen($fileName, 'r')) {
82+
if (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
8383
if ($handle = fopen($fileName, 'x')) {
8484
chmod($fileName, 0444);
85-
} elseif (!$handle = fopen($fileName, 'r')) {
85+
} elseif (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
8686
usleep(100); // Give some time for chmod() to complete
87-
$handle = fopen($fileName, 'r');
87+
$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r');
8888
}
8989
}
9090
restore_error_handler();

0 commit comments

Comments
 (0)