diff --git a/src/stream.c b/src/stream.c index 153e2f1..fa34a2d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef ENABLE_TLS #include @@ -123,7 +124,11 @@ static int stream__flush_plain(struct stream* self) if (n_msgs == 0) return 0; - bytes_sent = writev(self->fd, iov, n_msgs); + struct msghdr msghdr = { + .msg_iov = iov, + .msg_iovlen = n_msgs, + }; + bytes_sent = sendmsg(self->fd, &msghdr, MSG_NOSIGNAL); if (bytes_sent < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { stream__poll_rw(self);