diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2005-04-29 19:01:33 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2005-04-29 19:01:33 +0000 |
| commit | edd486067482514f8e8f1998612a1c251ac34671 (patch) | |
| tree | b38f595b2752070676866cf2e6811b4e30e71b37 /main/streams/streams.c | |
| parent | 217e89b1249f629695bf19772dfdf38bd16bf654 (diff) | |
| download | php-git-edd486067482514f8e8f1998612a1c251ac34671.tar.gz | |
Attempt to eliminate seek() prior to every write.
Diffstat (limited to 'main/streams/streams.c')
| -rwxr-xr-x | main/streams/streams.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index 68ce4f0a76..3729eaf74e 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -892,7 +892,7 @@ static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size /* if we have a seekable stream we need to ensure that data is written at the * current stream->position. This means invalidating the read buffer and then * performing a low-level seek */ - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { + if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && stream->readpos != stream->writepos) { stream->readpos = stream->writepos = 0; stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position TSRMLS_CC); |
