[FFmpeg-cvslog] avformat/network: check the return value from setsockopt()

Michael Niedermayer git at videolan.org
Mon Jun 3 16:16:24 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jun  3 16:11:29 2013 +0200| [c8faa47484466e70fd8be83c2ba7850cd818aa11] | committer: Michael Niedermayer

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

Fixes: CID1026742
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8faa47484466e70fd8be83c2ba7850cd818aa11
---

 libavformat/network.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index f80f43e..7d1a29f 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();



More information about the ffmpeg-cvslog mailing list