From: Timo Sirainen Date: Fri, 24 Sep 2021 15:59:29 +0000 (+0300) Subject: lib: o_stream_copy_error_from_parent() - Assert-crash if source stream_errno is 0 X-Git-Tag: 2.3.18~293 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=628933455216a859ecb4d7ba5c0dbb0a8abbd293;p=thirdparty%2Fdovecot%2Fcore.git lib: o_stream_copy_error_from_parent() - Assert-crash if source stream_errno is 0 This can help debug situations where error is missing. --- diff --git a/src/lib/ostream.c b/src/lib/ostream.c index eab68937a4..2f9c49dd9d 100644 --- a/src/lib/ostream.c +++ b/src/lib/ostream.c @@ -571,6 +571,8 @@ void o_stream_copy_error_from_parent(struct ostream_private *_stream) struct ostream *src = _stream->parent; struct ostream *dest = &_stream->ostream; + i_assert(src->stream_errno != 0); + dest->stream_errno = src->stream_errno; dest->overflow = src->overflow; if (src->closed)