]> git.sesse.net Git - vlc/commitdiff
Better thread-safety in previous commit
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Oct 2005 14:42:15 +0000 (14:42 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Oct 2005 14:42:15 +0000 (14:42 +0000)
src/misc/getaddrinfo.c

index 114d3241edbac49a4d5f8637404e36ef6f666164..08e31ca98f0d829dbc7d436fb61c25afa6338a96 100644 (file)
@@ -662,13 +662,13 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
 # ifdef AI_IDN
     /* Run-time I18n Domain Names support */
     {
-        static int i_idn = AI_IDN; /* beware of thread-safety */
+        static vlc_bool_t i_idn = VLC_TRUE; /* beware of thread-safety */
 
         if( i_idn )
         {
             int i_ret;
 
-            hints.ai_flags |= i_idn;
+            hints.ai_flags |= AI_IDN;
             i_ret = getaddrinfo( psz_node, psz_service, &hints, res );
 
             if( i_ret != EAI_BADFLAGS )
@@ -678,7 +678,7 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
 
             /* NOTE: Using i_idn here would not be thread-safe */
             hints.ai_flags &= ~AI_IDN;
-            i_idn = 0;
+            i_idn = VLC_FALSE;
             msg_Dbg( p_this, "I18n Domain Names not supported - disabled" );
         }
     }