diff options
| author | Dmitry Stogov <dmitry@php.net> | 2006-11-10 10:55:26 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2006-11-10 10:55:26 +0000 |
| commit | a5f951f27cf9937f0cfd43afe0ff8938faa7cfb4 (patch) | |
| tree | e3148b17be7cd6158b43b139979cfe49d14743c1 /main/streams/plain_wrapper.c | |
| parent | ab5268fc84c53396857b3b27ea54aa1438ffe024 (diff) | |
| download | php-git-a5f951f27cf9937f0cfd43afe0ff8938faa7cfb4.tar.gz | |
Removed unnecessary checks for ISREG file and corresponding stat() calls on Windows
Diffstat (limited to 'main/streams/plain_wrapper.c')
| -rw-r--r-- | main/streams/plain_wrapper.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index f61bde5c06..f2f016709b 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -891,6 +891,8 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha efree(persistent_id); } + /* WIN32 always set ISREG flag */ +#ifndef PHP_WIN32 /* sanity checks for include/require. * We check these after opening the stream, so that we save * on fstat() syscalls */ @@ -899,15 +901,12 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha int r; r = do_fstat(self, 0); - if ( -#ifndef PHP_WIN32 - (r != 0) || /* it is OK for fstat to fail under win32 */ -#endif - (r == 0 && !S_ISREG(self->sb.st_mode))) { + if ((r == 0 && !S_ISREG(self->sb.st_mode))) { php_stream_close(ret); return NULL; } } +#endif return ret; } |
