# HG changeset patch # User Timo Sirainen # Date 1490137537 -7200 # Node ID ad5fd5b950dbb33cd5b50e19772001e7b1e6f4fd # Parent 1481b5e5e717437f54553544a991d74785343f1b lib: Add missing error handling to o_stream_cork() With ostream-file the corking could have called buffer_flush(), which could have failed and set stream_errno, but nothing would set last_failed_errno. Fixes: Panic: file ostream.c: line 59 (o_stream_close_full): assertion failed: (stream->last_failed_errno != 0) diff -r 1481b5e5e717 -r ad5fd5b950db src/lib/ostream.c --- a/src/lib/ostream.c Mon Mar 20 20:21:56 2017 +0200 +++ b/src/lib/ostream.c Wed Mar 22 01:05:37 2017 +0200 @@ -144,6 +144,8 @@ return; _stream->cork(_stream, TRUE); + if (stream->stream_errno != 0) + errno = stream->last_failed_errno = stream->stream_errno; } void o_stream_uncork(struct ostream *stream)