diff options
author | Wez Furlong <wez@php.net> | 2002-12-19 20:23:50 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-12-19 20:23:50 +0000 |
commit | 602734c7d9f2ad58d1ce8cedd6384dbfbdfd06bb (patch) | |
tree | dee1039aa02085609bb6d9c7c5bf75cf1458c4ca /main/streams.c | |
parent | 183ebe3e14e621bf399212ccf1d030718077e8ec (diff) | |
download | php-git-602734c7d9f2ad58d1ce8cedd6384dbfbdfd06bb.tar.gz |
Correct mistake introduced by my last commit on these files;
*_from_pipe() is for process-pipes created by fopen, not generic pipes
created from proc_open().
Correctly implemented the fifo/pipe check for *_from_file() and it seems
to be working correctly now.
Diffstat (limited to 'main/streams.c')
-rwxr-xr-x | main/streams.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/streams.c b/main/streams.c index b8a67cfb4f..abfdd52255 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1298,6 +1298,7 @@ PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC) PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) { php_stdio_stream_data *self; + php_stream *stream; self = emalloc_rel_orig(sizeof(*self)); self->file = file; @@ -1314,7 +1315,13 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE } #endif - return php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); + stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); + + if (stream && self->is_pipe) { + stream->flags |= PHP_STREAM_FLAG_NO_SEEK; + } + + return stream; } PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) |