tcp: Check the listen call
authorJordi Ortiz <nenjordi@gmail.com>
Sat, 16 Jun 2012 10:29:53 +0000 (12:29 +0200)
committerMartin Storsjö <martin@martin.st>
Sun, 17 Jun 2012 10:22:36 +0000 (13:22 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/tcp.c

index a6eeeb0..7e348f7 100644 (file)
@@ -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();