Commit c8faa474 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/network: check the return value from setsockopt()

Fixes: CID1026742
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2fe4b621
...@@ -220,7 +220,9 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, ...@@ -220,7 +220,9 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
int ret; int ret;
int reuse = 1; int reuse = 1;
struct pollfd lp = { fd, POLLIN, 0 }; struct pollfd lp = { fd, POLLIN, 0 };
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)); if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))) {
av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_REUSEADDR) failed\n");
}
ret = bind(fd, addr, addrlen); ret = bind(fd, addr, addrlen);
if (ret) if (ret)
return ff_neterrno(); return ff_neterrno();
......
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