Merge commit '27852f2f1dec3749ea79883b70484c841169f747'

* commit '27852f2f1dec3749ea79883b70484c841169f747':
  libavformat: Handle error return from ff_listen_bind

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-04-09 20:47:20 +02:00
commit 71288bf80f
2 changed files with 7 additions and 8 deletions

View File

@ -126,11 +126,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
} }
if (s->listen) { if (s->listen) {
if ((fd = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen, if ((ret = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
s->listen_timeout, h)) < 0) { s->listen_timeout, h)) < 0) {
ret = fd;
goto fail1; goto fail1;
} }
fd = ret;
} else { } else {
if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen, if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
s->open_timeout / 1000, h, !!cur_ai->ai_next)) < 0) { s->open_timeout / 1000, h, !!cur_ai->ai_next)) < 0) {

View File

@ -74,12 +74,11 @@ static int unix_open(URLContext *h, const char *filename, int flags)
return ff_neterrno(); return ff_neterrno();
if (s->listen) { if (s->listen) {
fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr, ret = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
sizeof(s->addr), s->timeout, h); sizeof(s->addr), s->timeout, h);
if (fd < 0) { if (ret < 0)
ret = fd;
goto fail; goto fail;
} fd = ret;
} else { } else {
ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr, ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,
sizeof(s->addr), s->timeout, h, 0); sizeof(s->addr), s->timeout, h, 0);