diff --git a/spa/plugins/avb/avb-pcm.c b/spa/plugins/avb/avb-pcm.c index c7ccb05b6..0adc7e366 100644 --- a/spa/plugins/avb/avb-pcm.c +++ b/spa/plugins/avb/avb-pcm.c @@ -877,7 +877,7 @@ static int flush_write(struct state *state, uint64_t current_time) SPA_AVBTP_PACKET_AAF_SET_SEQ_NUM(pdu, state->pdu_seq++); SPA_AVBTP_PACKET_AAF_SET_TIMESTAMP(pdu, ptime); - n = sendmsg(state->sockfd, &state->msg, 0); + n = sendmsg(state->sockfd, &state->msg, MSG_NOSIGNAL); if (n < 0 || n != (ssize_t)state->pdu_size) { spa_log_error(state->log, "sendmdg() failed: %m"); } diff --git a/src/modules/module-avb/stream.c b/src/modules/module-avb/stream.c index b86f0814c..0f5b148e8 100644 --- a/src/modules/module-avb/stream.c +++ b/src/modules/module-avb/stream.c @@ -136,7 +136,7 @@ static int flush_write(struct stream *stream, uint64_t current_time) p->timestamp = ptime; p->dbc = dbc; - n = sendmsg(stream->source->fd, &stream->msg, 0); + n = sendmsg(stream->source->fd, &stream->msg, MSG_NOSIGNAL); if (n < 0 || n != (ssize_t)stream->pdu_size) { pw_log_error("sendmsg() failed %zd != %zd: %m", n, stream->pdu_size); diff --git a/src/modules/module-protocol-native/connection.c b/src/modules/module-protocol-native/connection.c index 6383024bb..78e84b552 100644 --- a/src/modules/module-protocol-native/connection.c +++ b/src/modules/module-protocol-native/connection.c @@ -221,7 +221,10 @@ static int refill_buffer(struct pw_protocol_native_connection *conn, struct buff struct cmsghdr *cmsg = NULL; struct msghdr msg = { 0 }; struct iovec iov[1]; - char cmsgbuf[CMSG_SPACE(MAX_FDS_MSG * sizeof(int))]; + union { + char cmsgbuf[CMSG_SPACE(MAX_FDS_MSG * sizeof(int))]; + struct cmsghdr align; + } cmsgbuf; int n_fds = 0; size_t avail; @@ -231,7 +234,7 @@ static int refill_buffer(struct pw_protocol_native_connection *conn, struct buff iov[0].iov_len = avail; msg.msg_iov = iov; msg.msg_iovlen = 1; - msg.msg_control = cmsgbuf; + msg.msg_control = &cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); msg.msg_flags = MSG_CMSG_CLOEXEC | MSG_DONTWAIT; @@ -755,7 +758,10 @@ int pw_protocol_native_connection_flush(struct pw_protocol_native_connection *co struct msghdr msg = { 0 }; struct iovec iov[1]; struct cmsghdr *cmsg; - char cmsgbuf[CMSG_SPACE(MAX_FDS_MSG * sizeof(int))]; + union { + char cmsgbuf[CMSG_SPACE(MAX_FDS_MSG * sizeof(int))]; + struct cmsghdr align; + } cmsgbuf; int res = 0, *fds; uint32_t fds_len, to_close, n_fds, outfds, i; struct buffer *buf; @@ -786,7 +792,7 @@ int pw_protocol_native_connection_flush(struct pw_protocol_native_connection *co msg.msg_iovlen = 1; if (outfds > 0) { - msg.msg_control = cmsgbuf; + msg.msg_control = &cmsgbuf; msg.msg_controllen = CMSG_SPACE(fds_len); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET;