Skip to content

Commit a527b20

Browse files
committed
fixed possible race condition when creating a directory
1 parent 57ff2e2 commit a527b20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ protected function buildContainer()
605605
{
606606
foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) {
607607
if (!is_dir($dir)) {
608-
if (false === @mkdir($dir, 0777, true)) {
608+
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
609609
throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
610610
}
611611
} elseif (!is_writable($dir)) {

0 commit comments

Comments
 (0)