We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 749410a + 7adb641 commit f63579dCopy full SHA for f63579d
src/Symfony/Component/Filesystem/LockHandler.php
@@ -75,12 +75,12 @@ public function lock($blocking = false)
75
$error = $msg;
76
});
77
78
- if (!$this->handle = fopen($this->file, 'r')) {
+ if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
79
if ($this->handle = fopen($this->file, 'x')) {
80
chmod($this->file, 0444);
81
- } elseif (!$this->handle = fopen($this->file, 'r')) {
+ } elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
82
usleep(100); // Give some time for chmod() to complete
83
- $this->handle = fopen($this->file, 'r');
+ $this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r');
84
}
85
86
restore_error_handler();
0 commit comments