From fdaf4613d8d90f715260c61e59457307da6f939c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 2 Mar 2022 11:28:43 +0100 Subject: [PATCH] module-raop: handle and debug read errors Fixes #2183 --- src/modules/module-raop-sink.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index d7399c849..15b7be918 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -584,6 +584,10 @@ on_timing_source_io(void *data, int fd, uint32_t mask) received = ntp_now(CLOCK_MONOTONIC); bytes = read(impl->timing_fd, packet, sizeof(packet)); + if (bytes < 0) { + pw_log_debug("error reading timing packet: %m"); + return; + } if (bytes != sizeof(packet)) { pw_log_warn("discarding short (%zd < %zd) timing packet", bytes, sizeof(bytes)); @@ -610,6 +614,10 @@ on_control_source_io(void *data, int fd, uint32_t mask) uint16_t seq, num; bytes = read(impl->control_fd, packet, sizeof(packet)); + if (bytes < 0) { + pw_log_debug("error reading control packet: %m"); + return; + } if (bytes != sizeof(packet)) { pw_log_warn("discarding short (%zd < %zd) control packet", bytes, sizeof(bytes));