From c8faa47484466e70fd8be83c2ba7850cd818aa11 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 3 Jun 2013 16:11:29 +0200 Subject: [PATCH] avformat/network: check the return value from setsockopt() Fixes: CID1026742 Signed-off-by: Michael Niedermayer --- libavformat/network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/network.c b/libavformat/network.c index f80f43ec2a..7d1a29f3e5 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -220,7 +220,9 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, int ret; int reuse = 1; 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); if (ret) return ff_neterrno();