Skip to content

Commit 8a721a5

Browse files
Merge branch '2.8' into 3.4
* 2.8: [HttpKernel] fix test compat with PHP 5.3 fix file lock on SunOS change `evaluate()` docblock return type from string to mixed Set serialize_precision explicitly to avoid fancy float rounding
2 parents 8e03ca3 + 0f685c0 commit 8a721a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

LockHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ public function lock($blocking = false)
8181
$error = $msg;
8282
});
8383

84-
if (!$this->handle = fopen($this->file, 'r')) {
84+
if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
8585
if ($this->handle = fopen($this->file, 'x')) {
8686
chmod($this->file, 0444);
87-
} elseif (!$this->handle = fopen($this->file, 'r')) {
87+
} elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
8888
usleep(100); // Give some time for chmod() to complete
89-
$this->handle = fopen($this->file, 'r');
89+
$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r');
9090
}
9191
}
9292
restore_error_handler();

0 commit comments

Comments
 (0)