This caused some write errors not to be detected, such as in code like:
o_stream_cork()
o_stream_nsend(..)
o_stream_uncork()
if (o_stream_nfinish() < 0) {
// error not detected because last_failed_errno was 0
}
if (unlikely(stream->closed))
return;
+ stream->stream_errno = 0;
_stream->cork(_stream, FALSE);
+ if (stream->stream_errno != 0)
+ errno = stream->last_failed_errno = stream->stream_errno;
}
bool o_stream_is_corked(struct ostream *stream)