aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-08-24 01:08:47 +0200
committerMax Kellermann <max@duempel.org>2011-08-24 01:47:22 +0200
commit9729dc759457ab9b15df658c05ca35a39d377428 (patch)
tree7b62e01a00ac4b6daced5f27c56e859160ee8b2f
parent92c1b8f31e09f47aafc2c50a370058458837fac9 (diff)
downloadmpd-9729dc759457ab9b15df658c05ca35a39d377428.tar.gz
mpd-9729dc759457ab9b15df658c05ca35a39d377428.tar.xz
mpd-9729dc759457ab9b15df658c05ca35a39d377428.zip
output/raop: rtspcl_connect() returns false on error
.. and not -1, which is "true".
-rw-r--r--src/output/raop_output_plugin.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/output/raop_output_plugin.c b/src/output/raop_output_plugin.c
index db465643d..cdfbd5bcc 100644
--- a/src/output/raop_output_plugin.c
+++ b/src/output/raop_output_plugin.c
@@ -708,8 +708,12 @@ rtspcl_connect(struct rtspcl_data *rtspcld, const char *host, short destport,
struct sockaddr_in name;
socklen_t namelen = sizeof(name);
- if ((rtspcld->fd = open_tcp_socket(NULL, &myport)) == -1) return -1;
- if (!get_tcp_connect_by_host(rtspcld->fd, host, destport)) return -1;
+ if ((rtspcld->fd = open_tcp_socket(NULL, &myport)) == -1)
+ return false;
+
+ if (!get_tcp_connect_by_host(rtspcld->fd, host, destport))
+ return false;
+
getsockname(rtspcld->fd, (struct sockaddr*)&name, &namelen);
memcpy(&rtspcld->local_addr, &name.sin_addr,sizeof(struct in_addr));
sprintf(rtspcld->url, "rtsp://%s/%s", inet_ntoa(name.sin_addr), sid);
@@ -1288,7 +1292,9 @@ raop_output_open(void *data, struct audio_format *audio_format, GError **error_r
raop_session->raop_list = rd;
rd->is_master = true;
- if ((raop_session->data_fd = open_udp_socket(NULL, &myport)) == -1) return -1;
+ if ((raop_session->data_fd = open_udp_socket(NULL, &myport)) == -1)
+ return false;
+
if ((raop_session->ntp.fd = open_udp_socket(NULL, &raop_session->ntp.port)) == -1) return false;
if ((raop_session->ctrl.fd = open_udp_socket(NULL, &raop_session->ctrl.port)) == -1) {
close(raop_session->ntp.fd);