git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/branches/ZeroRadiant@250
8a3a26a2-13c4-0310-b231-
cf6edde360e5
//===========================================================================
int Net_Setup(void)
{
- WINS_Init();
+ if( !WINS_Init() )
+ return qfalse;
+
//
WinPrint("my address is %s\n", WINS_MyAddress());
//
// determine my name & address
gethostname(buff, MAXHOSTNAMELEN);
local = gethostbyname(buff);
+
+ // When hostname can not be resolved, return gracefully
+ if( local == 0 )
+ {
+ WinError("WINS_Init: Unable to resolve hostname\n");
+ return 0;
+ }
+
myAddr = *(int *)local->h_addr_list[0];
// if the quake hostname isn't set, set it to the machine name
}
#endif
Sys_Printf("Setting up\n");
- Net_Setup();
- m_pListenSocket = Net_ListenSocket(39000);
+ if( !Net_Setup() )
+ return false;
+
+ m_pListenSocket = Net_ListenSocket(39000);
if (m_pListenSocket == NULL)
return false;
+
Sys_Printf("Listening...\n");
return true;
}