fix crashes and leaks on shutdown

This commit is contained in:
Wim Taymans 2017-10-17 10:14:56 +02:00
parent f817aabe24
commit 323c644084
5 changed files with 27 additions and 5 deletions

View file

@ -137,7 +137,7 @@ static bool refill_buffer(struct pw_protocol_native_connection *conn, struct buf
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
msg.msg_flags = MSG_CMSG_CLOEXEC;
msg.msg_flags = MSG_CMSG_CLOEXEC | MSG_DONTWAIT;
while (true) {
len = recvmsg(conn->fd, &msg, msg.msg_flags);
@ -482,7 +482,7 @@ bool pw_protocol_native_connection_flush(struct pw_protocol_native_connection *c
}
while (true) {
len = sendmsg(conn->fd, &msg, MSG_NOSIGNAL);
len = sendmsg(conn->fd, &msg, MSG_NOSIGNAL | MSG_DONTWAIT);
if (len < 0) {
if (errno == EINTR)
continue;