The default uloop error handling is to delete the fd. Continue to do
that, but also set the write_error flag and notify the user.
Signed-off-by: Philip Craig <philipjcraig@gmail.com>
{
struct ustream_fd *sf = container_of(s, struct ustream_fd, stream);
struct ustream_buf *buf;
- unsigned int flags = ULOOP_EDGE_TRIGGER;
+ unsigned int flags = ULOOP_EDGE_TRIGGER | ULOOP_ERROR_CB;
if (!s->read_blocked && !s->eof)
flags |= ULOOP_READ;
ustream_fd_set_uloop(s, false);
}
+ if (sf->fd.error && !s->write_error) {
+ ustream_state_change(s);
+ s->write_error = true;
+ ustream_fd_set_uloop(s, false);
+ }
+
return more;
}