8000 fix file lock on SunOS · symfony/symfony@7adb641 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7adb641

Browse files
committed
fix file lock on SunOS
1 parent 00b6f53 commit 7adb641

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Filesystem/LockHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ public function lock($blocking = false)
7575
$error = $msg;
7676
});
7777

78-
if (!$this->handle = fopen($this->file, 'r')) {
78+
if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
7979
if ($this->handle = fopen($this->file, 'x')) {
8080
chmod($this->file, 0444);
81-
} elseif (!$this->handle = fopen($this->file, 'r')) {
81+
} elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
8282
usleep(100); // Give some time for chmod() to complete
83-
$this->handle = fopen($this->file, 'r');
83+
$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r');
8484
}
8585
}
8686
restore_error_handler();

0 commit comments

Comments
 (0)
0