From: Timo Sirainen Date: Tue, 27 Feb 2024 11:57:51 +0000 (+0200) Subject: lib: istream-sized - Always preserve parent stream error X-Git-Tag: 2.4.1~1025 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14ea1ac3540cbb054088fe91975a21c6bea41851;p=thirdparty%2Fdovecot%2Fcore.git lib: istream-sized - Always preserve parent stream error Only ENOENT errors were preserved previously. --- diff --git a/src/lib/istream-sized.c b/src/lib/istream-sized.c index afe95b79a2..b98a4a1aea 100644 --- a/src/lib/istream-sized.c +++ b/src/lib/istream-sized.c @@ -114,8 +114,8 @@ static ssize_t i_stream_sized_read(struct istream_private *stream) } } else if (!stream->istream.eof) { /* still more to read */ - } else if (stream->istream.stream_errno == ENOENT) { - /* lost the file */ + } else if (stream->istream.stream_errno != 0) { + /* parent stream read() failed - preserve the error */ } else { /* EOF before we reached the wanted size */ error = sstream->error_callback(&data, sstream->error_context);