Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion main/streams/plain_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand All @@ -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;
}
}
Expand Down