File 0003-modules-improve-error-reporting.patch of Package pipewire
From 6e2522b657aafe08b1ffe66531c49db07d793907 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Mon, 2 Mar 2026 12:13:22 +0100
Subject: [PATCH] modules: improve error reporting
Instead of reporting -EPIPE, get the error from the socket and report
that instead.
---
src/modules/module-raop/rtsp-client.c | 7 ++++++-
src/modules/module-sendspin/websocket.c | 7 ++++++-
src/modules/module-snapcast-discover.c | 7 ++++++-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/modules/module-raop/rtsp-client.c b/src/modules/module-raop/rtsp-client.c
index fae71977c..574f9f3e4 100644
--- a/src/modules/module-raop/rtsp-client.c
+++ b/src/modules/module-raop/rtsp-client.c
@@ -445,7 +445,12 @@ on_source_io(void *data, int fd, uint32_t mask)
int res;
if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
- res = -EPIPE;
+ socklen_t len = sizeof(res);
+ if ((mask & SPA_IO_HUP) ||
+ getsockopt(fd, SOL_SOCKET, SO_ERROR, &res, &len) < 0)
+ res = -EPIPE;
+ else
+ res = -res;
goto error;
}
if (mask & SPA_IO_IN) {
#diff --git a/src/modules/module-sendspin/websocket.c b/src/modules/module-sendspin/websocket.c
#index b6ddf629f..e0d5a717d 100644
#--- a/src/modules/module-sendspin/websocket.c
#+++ b/src/modules/module-sendspin/websocket.c
#@@ -712,7 +712,12 @@ on_source_io(void *data, int fd, uint32_t mask)
# conn->refcount++;
#
# if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
#- res = -EPIPE;
#+ socklen_t len = sizeof(res);
#+ if ((mask & SPA_IO_HUP) ||
#+ getsockopt(fd, SOL_SOCKET, SO_ERROR, &res, &len) < 0)
#+ res = -EPIPE;
#+ else
#+ res = -res;
# goto error;
# }
# if (mask & SPA_IO_IN) {
diff --git a/src/modules/module-snapcast-discover.c b/src/modules/module-snapcast-discover.c
index 2561a7304..0e9fef1a1 100644
--- a/src/modules/module-snapcast-discover.c
+++ b/src/modules/module-snapcast-discover.c
@@ -381,7 +381,12 @@ on_source_io(void *data, int fd, uint32_t mask)
int res;
if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
- res = -EPIPE;
+ socklen_t len = sizeof(res);
+ if ((mask & SPA_IO_HUP) ||
+ getsockopt(fd, SOL_SOCKET, SO_ERROR, &res, &len) < 0)
+ res = -EPIPE;
+ else
+ res = -res;
goto error;
}
if (mask & SPA_IO_IN) {
--
GitLab