summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index d510c909a7..7ede3718b5 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -42,6 +42,8 @@
#ifdef PHP_WIN32
# include "win32/winutil.h"
# include "win32/time.h"
+# include "win32/ioutil.h"
+# include "win32/readdir.h"
#endif
#define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC)
@@ -465,7 +467,11 @@ static int php_stdiop_close(php_stream *stream, int close_handle)
return 0; /* everything should be closed already -> success */
}
if (data->temp_name) {
+#ifdef PHP_WIN32
+ php_win32_ioutil_unlink(ZSTR_VAL(data->temp_name));
+#else
unlink(ZSTR_VAL(data->temp_name));
+#endif
/* temporary streams are never persistent */
zend_string_release(data->temp_name);
data->temp_name = NULL;
@@ -987,9 +993,11 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zen
return ret;
}
}
-
+#ifdef PHP_WIN32
+ fd = php_win32_ioutil_open(realpath, open_flags, 0666);
+#else
fd = open(realpath, open_flags, 0666);
-
+#endif
if (fd != -1) {
if (options & STREAM_OPEN_FOR_INCLUDE) {