]> git.sur5r.net Git - openldap/commitdiff
Fix for Windows, don't call gethostbyname until WSAStartup has occurred.
authorHoward Chu <hyc@openldap.org>
Fri, 4 Jan 2002 23:10:48 +0000 (23:10 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 4 Jan 2002 23:10:48 +0000 (23:10 +0000)
libraries/libldap/init.c

index c167a00592042adb61f9af8113fc185d0ae6212a..46f8f7768a957632851a906fb24b5429f33c55b0 100644 (file)
@@ -448,11 +448,6 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 
        ldap_int_error_init();
 
-#if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) \
-       || defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
-       ldap_int_hostname = ldap_pvt_get_fqdn( ldap_int_hostname );
-#endif
-
 #ifdef HAVE_WINSOCK2
 {      WORD wVersionRequested;
        WSADATA wsaData;
@@ -485,6 +480,11 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
            return;
        }
 }
+#endif
+
+#if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) \
+       || defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
+       ldap_int_hostname = ldap_pvt_get_fqdn( ldap_int_hostname );
 #endif
        ldap_int_utils_init();