From b80c329a25b5b07f5e68cd44ef0fef9db6613486 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 26 Oct 2014 01:00:36 +0300 Subject: [PATCH] lib: If i_stream_seek() works by reading forward and read() fails, don't override the error message. --- src/lib/istream.c | 4 ++++ 1 file changed, 4 insertions(+) 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 %" -- 2.47.3