From: Timo Sirainen Date: Sat, 25 Oct 2014 22:00:36 +0000 (+0300) Subject: lib: If i_stream_seek() works by reading forward and read() fails, don't override... X-Git-Tag: 2.2.16.rc1~286 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b80c329a25b5b07f5e68cd44ef0fef9db6613486;p=thirdparty%2Fdovecot%2Fcore.git lib: If i_stream_seek() works by reading forward and read() fails, don't override the error message. --- diff --git a/src/lib/istream.c b/src/lib/istream.c index bcf59a300f..ea205b5dd2 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -749,6 +749,10 @@ void i_stream_default_seek_nonseekable(struct istream_private *stream, available = stream->pos - stream->skip; if (available == 0) { + if (stream->istream.stream_errno != 0) { + /* read failed */ + return; + } io_stream_set_error(&stream->iostream, "Can't seek to offset %"PRIuUOFF_T ", because we have data only up to offset %"