Skip to content

Commit 9ac133a

Browse files
committed
Switch to ioutil routines to support long path in file cache
1 parent 871d0aa commit 9ac133a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ static int zend_file_cache_mkdir(char *filename, size_t start)
169169
if (IS_SLASH(*s)) {
170170
char old = *s;
171171
*s = '\000';
172+
#ifndef ZEND_WIN32
172173
if (mkdir(filename, S_IRWXU) < 0 && errno != EEXIST) {
174+
#else
175+
if (php_win32_ioutil_mkdir(filename, 0700) < 0 && errno != EEXIST) {
176+
#endif
173177
*s = old;
174178
return FAILURE;
175179
}
@@ -832,7 +836,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
832836
#ifndef ZEND_WIN32
833837
fd = open(filename, O_CREAT | O_EXCL | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
834838
#else
835-
fd = open(filename, O_CREAT | O_EXCL | O_RDWR | O_BINARY, _S_IREAD | _S_IWRITE);
839+
fd = php_win32_ioutil_open(filename, O_CREAT | O_EXCL | O_RDWR | O_BINARY, _S_IREAD | _S_IWRITE);
836840
#endif
837841
if (fd < 0) {
838842
if (errno != EEXIST) {

0 commit comments

Comments
 (0)