Commit 71288bf8 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '27852f2f'

* commit '27852f2f':
  libavformat: Handle error return from ff_listen_bind
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 7ef59803 27852f2f
......@@ -126,11 +126,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
}
if (s->listen) {
if ((fd = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
s->listen_timeout, h)) < 0) {
ret = fd;
if ((ret = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
s->listen_timeout, h)) < 0) {
goto fail1;
}
fd = ret;
} else {
if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
s->open_timeout / 1000, h, !!cur_ai->ai_next)) < 0) {
......
......@@ -74,12 +74,11 @@ static int unix_open(URLContext *h, const char *filename, int flags)
return ff_neterrno();
if (s->listen) {
fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
sizeof(s->addr), s->timeout, h);
if (fd < 0) {
ret = fd;
ret = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
sizeof(s->addr), s->timeout, h);
if (ret < 0)
goto fail;
}
fd = ret;
} else {
ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,
sizeof(s->addr), s->timeout, h, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment