]> git.sesse.net Git - vlc/commitdiff
net_OpenDgram don't return 0 in case of failure
authorSébastien Escudier <sebastien-devel@celeos.eu>
Thu, 21 Oct 2010 06:48:49 +0000 (08:48 +0200)
committerSébastien Escudier <sebastien-devel@celeos.eu>
Thu, 21 Oct 2010 06:48:49 +0000 (08:48 +0200)
src/network/udp.c

index 5af1c0b634774a0851d4bc9b8acf7156dee058fb..e72c42610a045733e8fd861ab8f17ff4246f00b0 100644 (file)
@@ -778,6 +778,7 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
         return -1;
     }
 
+    val = -1;
     for (struct addrinfo *ptr = loc; ptr != NULL; ptr = ptr->ai_next)
     {
         int fd = net_Socket (obj, ptr->ai_family, ptr->ai_socktype,
@@ -789,7 +790,6 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
         if( fd == -1 )
             continue;
 
-        val = -1;
         for (struct addrinfo *ptr2 = rem; ptr2 != NULL; ptr2 = ptr2->ai_next)
         {
             if ((ptr2->ai_family != ptr->ai_family)