mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Improve the success rate when use mkdir() in multiprocessing environment (#7383)
Improve the success rate when use mkdir() in multiprocessing environment
This commit is contained in:
parent
0b98ac69d9
commit
aec08cc841
@ -1414,7 +1414,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
|
||||
}
|
||||
while (true) {
|
||||
int ret = VCWD_MKDIR(buf, (mode_t) mode);
|
||||
if (ret < 0) {
|
||||
if (ret < 0 && errno != EEXIST) {
|
||||
if (options & REPORT_ERRORS) {
|
||||
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
|
||||
}
|
||||
@ -1433,6 +1433,13 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
|
||||
}
|
||||
if (p == e || !replaced_slash) {
|
||||
/* No more directories to create */
|
||||
/* issue a warning to client when the last directory was created failed */
|
||||
if (ret < 0) {
|
||||
if (options & REPORT_ERRORS) {
|
||||
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user