From: Wez Furlong Date: Sun, 25 Aug 2002 11:02:05 +0000 (+0000) Subject: Potential fix for Bug#18022: X-Git-Tag: RELEASE_0_91~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d2fb453287cd128ed1592931ba46ca5070594a9;p=php 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. --- 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';