dovecot-2.2: lib: Never implicitly clear istream's stream_errno.

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 13 07:55:08 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/e3b52d11d038
changeset: 18077:e3b52d11d038
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 13 09:39:24 2014 +0200
description:
lib: Never implicitly clear istream's stream_errno.
I'm not really sure why these were added in the first place. At some point
the stream_errno was cleared in more places, such as just before reading,
but those were also removed already. I don't see any benefit for these, just
potential problems.

diffstat:

 src/lib/istream.c |  6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diffs (24 lines):

diff -r dc593d4dbeb3 -r e3b52d11d038 src/lib/istream.c
--- a/src/lib/istream.c	Thu Nov 13 09:35:59 2014 +0200
+++ b/src/lib/istream.c	Thu Nov 13 09:39:24 2014 +0200
@@ -250,7 +250,6 @@
 	if (unlikely(stream->closed))
 		return;
 
-	stream->stream_errno = 0;
 	_stream->seek(_stream, stream->v_offset + count, FALSE);
 }
 
@@ -398,11 +397,8 @@
 	struct istream_private *_stream = stream->real_stream;
 	const unsigned char *pos;
 
-	if (_stream->skip >= _stream->pos) {
-		if (!unlikely(stream->closed))
-			stream->stream_errno = 0;
+	if (_stream->skip >= _stream->pos)
 		return NULL;
-	}
 
 	pos = memchr(_stream->buffer + _stream->skip, '\n',
 		     _stream->pos - _stream->skip);


More information about the dovecot-cvs mailing list