]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-sized - Always preserve parent stream error
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 27 Feb 2024 11:57:51 +0000 (13:57 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:39:58 +0000 (10:39 +0200)
Only ENOENT errors were preserved previously.

src/lib/istream-sized.c

index afe95b79a25680755761a66e4142417de44d393c..b98a4a1aea6585907343578ed4bb90287eae7518 100644 (file)
@@ -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);