From 14ea1ac3540cbb054088fe91975a21c6bea41851 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 27 Feb 2024 13:57:51 +0200 Subject: [PATCH] lib: istream-sized - Always preserve parent stream error Only ENOENT errors were preserved previously. --- src/lib/istream-sized.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.3