From: havoc Date: Fri, 28 Mar 2003 03:23:13 +0000 (+0000) Subject: removed winsock_initialized counter as there are no longer two things initializing... X-Git-Tag: xonotic-v0.1.0preview~6708 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dd62e56831ec76c8dc23f5cea69e883e31983392;p=xonotic%2Fdarkplaces.git removed winsock_initialized counter as there are no longer two things initializing winsock (wins and wipx), only one git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2863 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/net_wins.c b/net_wins.c index 30d1d41a..fea9a91d 100644 --- a/net_wins.c +++ b/net_wins.c @@ -33,7 +33,6 @@ static unsigned long myAddr; #include "net_wins.h" -int winsock_initialized = 0; WSADATA winsockdata; //============================================================================= @@ -101,23 +100,18 @@ int WINS_Init (void) if (COM_CheckParm ("-noudp")) return -1; - if (winsock_initialized == 0) + r = WSAStartup (MAKEWORD(1, 1), &winsockdata); + if (r) { - r = WSAStartup (MAKEWORD(1, 1), &winsockdata); - if (r) - { - Con_SafePrintf ("Winsock initialization failed.\n"); - return -1; - } + Con_SafePrintf ("Winsock initialization failed.\n"); + return -1; } - winsock_initialized++; // determine my name if (gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR) { Con_DPrintf ("Winsock TCP/IP Initialization failed.\n"); - if (--winsock_initialized == 0) - WSACleanup (); + WSACleanup (); return -1; } @@ -164,8 +158,7 @@ int WINS_Init (void) if ((net_controlsocket = WINS_OpenSocket (0)) == -1) { Con_Printf("WINS_Init: Unable to open control socket\n"); - if (--winsock_initialized == 0) - WSACleanup (); + WSACleanup (); return -1; } @@ -185,8 +178,7 @@ void WINS_Shutdown (void) { WINS_Listen (false); WINS_CloseSocket (net_controlsocket); - if (--winsock_initialized == 0) - WSACleanup (); + WSACleanup (); } //=============================================================================