]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/unix.c
Merge commit '247aa7af7d8197247c181e3fbfe8d93d75e41b29'
[ffmpeg] / libavformat / unix.c
index 397706528aa3fcac294dd71c577b5b1ec4865a17..63d1db248f7a2acba549367fdee967c5aff2af2c 100644 (file)
@@ -74,12 +74,11 @@ static int unix_open(URLContext *h, const char *filename, int flags)
         return ff_neterrno();
 
     if (s->listen) {
-        fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
-                            sizeof(s->addr), s->timeout, h);
-        if (fd < 0) {
-            ret = fd;
+        ret = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
+                             sizeof(s->addr), s->timeout, h);
+        if (ret < 0)
             goto fail;
-        }
+        fd = ret;
     } else {
         ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,
                                 sizeof(s->addr), s->timeout, h, 0);