diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-07-03 22:42:10 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-07-03 22:42:10 -0500 |
commit | d9a9cf8ecaef891b2369969e9efe9f6261359158 (patch) | |
tree | 04bcc83b3c9be1924007e007e1f508f7229af7ab /main/streams/plain_wrapper.c | |
parent | 583386d59e6b362fe49e51594718a109d0c0cc2f (diff) | |
parent | c2b29a58bc0916e248ba2584564558097b16b51f (diff) | |
download | php-git-d9a9cf8ecaef891b2369969e9efe9f6261359158.tar.gz |
Merge branch 'master' into iterable
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r-- | main/streams/plain_wrapper.c | 12 |
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) { |