From: Stephan Bosch Date: Sun, 3 Apr 2016 20:54:17 +0000 (+0200) Subject: istream-unix: Fixed handling of EOF from fd_read() (ret==0). X-Git-Tag: 2.2.24~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d17a99d9e1c314333d0118228ebb02ee9d60b4f1;p=thirdparty%2Fdovecot%2Fcore.git istream-unix: Fixed handling of EOF from fd_read() (ret==0). This situation was ignored. --- diff --git a/src/lib/istream-unix.c b/src/lib/istream-unix.c index fb6e8e1ac7..f4465a9d37 100644 --- a/src/lib/istream-unix.c +++ b/src/lib/istream-unix.c @@ -44,6 +44,13 @@ static ssize_t i_stream_unix_read(struct istream_private *stream) if (ustream->read_fd != -1) ustream->next_read_fd = FALSE; + if (ret == 0) { + /* EOF */ + stream->istream.eof = TRUE; + ustream->fstream.seen_eof = TRUE; + return -1; + } + if (unlikely(ret < 0)) { if (errno == EINTR || errno == EAGAIN) { i_assert(!stream->istream.blocking);