From: Kurt Zeilenga Date: Fri, 21 Jul 2000 22:47:46 +0000 (+0000) Subject: Share function declarations between varients X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2394 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=27f674a926c1e8af9649128282dcd01812d47972;p=openldap Share function declarations between varients --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index c230314608..8f50d623d1 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -1205,9 +1205,9 @@ int slapd_daemon( void ) } -#ifdef HAVE_WINSOCK2 int sockinit(void) { +#if defined( HAVE_WINSOCK2 ) WORD wVersionRequested; WSADATA wsaData; int err; @@ -1237,40 +1237,22 @@ int sockinit(void) } /* The WinSock DLL is acceptable. Proceed. */ - return 0; -} - -int sockdestroy(void) -{ - WSACleanup(); - return 0; -} - -#elif HAVE_WINSOCK -static int sockinit(void) -{ +#elif defined( HAVE_WINSOCK ) WSADATA wsaData; if ( WSAStartup( 0x0101, &wsaData ) != 0 ) { return -1; } - return 0; -} -static int sockdestroy(void) -{ - WSACleanup(); +#endif return 0; } -#else -static int sockinit(void) -{ - return 0; -} -static int sockdestroy(void) +int sockdestroy(void) { +#if defined( HAVE_WINSOCK2 ) || defined( HAVE_WINSOCK ) + WSACleanup(); +#endif return 0; } -#endif RETSIGTYPE slap_sig_shutdown( int sig )