From a7cc78cb11dfdd356d83a2bdbb00eb92c1367379 Mon Sep 17 00:00:00 2001 From: Jordi Ortiz Date: Sat, 16 Jun 2012 12:29:53 +0200 Subject: tcp: Check the listen call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/tcp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libavformat/tcp.c') diff --git a/libavformat/tcp.c b/libavformat/tcp.c index a6eeeb0d0f..7e348f7729 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -90,7 +90,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags) ret = ff_neterrno(); goto fail1; } - listen(fd, 1); + ret = listen(fd, 1); + if (ret) { + ret = ff_neterrno(); + goto fail1; + } fd1 = accept(fd, NULL, NULL); if (fd1 < 0) { ret = ff_neterrno(); -- cgit v1.2.3