diff options
author | Wez Furlong <wez@php.net> | 2002-08-25 11:02:05 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-08-25 11:02:05 +0000 |
commit | 6d2fb453287cd128ed1592931ba46ca5070594a9 (patch) | |
tree | b476578fb16ea630587bca98238dfe507ba514e2 | |
parent | 509ad5ec0fbbf7a03fbebc2c6b699e37355feff3 (diff) | |
download | php-git-6d2fb453287cd128ed1592931ba46ca5070594a9.tar.gz |
Potential fix for Bug#18022:
Streams that are pipes on systems that HAVE_FLUSHIO should not be seeked
as is required for plain files on those systems.
-rwxr-xr-x | main/streams.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/streams.c b/main/streams.c index 38bf8dae32..71d823df81 100755 --- a/main/streams.c +++ b/main/streams.c @@ -774,7 +774,7 @@ static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count assert(data != NULL); #if HAVE_FLUSHIO - if (data->last_op == 'r') { + if (!data->is_pipe && data->last_op == 'r') { fseek(data->file, 0, SEEK_CUR); } data->last_op = 'w'; @@ -798,7 +798,7 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS } #if HAVE_FLUSHIO - if (data->last_op == 'w') + if (!data->is_pipe && data->last_op == 'w') fseek(data->file, 0, SEEK_CUR); data->last_op = 'r'; #endif @@ -856,7 +856,7 @@ static char *php_stdiop_gets(php_stream *stream, char *buf, size_t size TSRMLS_D assert(data != NULL); #if HAVE_FLUSHIO - if (data->last_op == 'w') { + if (!data->is_pipe && data->last_op == 'w') { fseek(data->file, 0, SEEK_CUR); } data->last_op = 'r'; |