mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-07-21 18:26:24 +00:00
raop: log last error on connection failure
This commit is contained in:
parent
de211f4e89
commit
9a93a60fbf
|
@ -490,6 +490,7 @@ int pw_rtsp_client_connect(struct pw_rtsp_client *client,
|
|||
pw_log_error("getaddrinfo: %s", gai_strerror(res));
|
||||
return -EINVAL;
|
||||
}
|
||||
res = -ENOENT;
|
||||
for (rp = result; rp != NULL; rp = rp->ai_next) {
|
||||
fd = socket(rp->ai_family,
|
||||
rp->ai_socktype | SOCK_CLOEXEC | SOCK_NONBLOCK,
|
||||
|
@ -501,12 +502,14 @@ int pw_rtsp_client_connect(struct pw_rtsp_client *client,
|
|||
if (res == 0 || (res < 0 && errno == EINPROGRESS))
|
||||
break;
|
||||
|
||||
res = -errno;
|
||||
close(fd);
|
||||
}
|
||||
freeaddrinfo(result);
|
||||
|
||||
if (rp == NULL) {
|
||||
pw_log_error("Could not connect to %s:%u", hostname, port);
|
||||
pw_log_error("Could not connect to %s:%u: %s", hostname, port,
|
||||
spa_strerror(res));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue