mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-22 05:33:53 -04:00
modules: improve error reporting
Instead of reporting -EPIPE, get the error from the socket and report that instead.
This commit is contained in:
parent
87087a4629
commit
6e2522b657
3 changed files with 18 additions and 3 deletions
|
|
@ -445,7 +445,12 @@ on_source_io(void *data, int fd, uint32_t mask)
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
|
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;
|
goto error;
|
||||||
}
|
}
|
||||||
if (mask & SPA_IO_IN) {
|
if (mask & SPA_IO_IN) {
|
||||||
|
|
|
||||||
|
|
@ -712,7 +712,12 @@ on_source_io(void *data, int fd, uint32_t mask)
|
||||||
conn->refcount++;
|
conn->refcount++;
|
||||||
|
|
||||||
if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
|
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;
|
goto error;
|
||||||
}
|
}
|
||||||
if (mask & SPA_IO_IN) {
|
if (mask & SPA_IO_IN) {
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,12 @@ on_source_io(void *data, int fd, uint32_t mask)
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (mask & (SPA_IO_ERR | SPA_IO_HUP)) {
|
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;
|
goto error;
|
||||||
}
|
}
|
||||||
if (mask & SPA_IO_IN) {
|
if (mask & SPA_IO_IN) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue