miniupnpcmodule.c: check return of WSAStartup()
This commit is contained in:
parent
33de3996d7
commit
6ae3445c2e
|
@ -676,6 +676,16 @@ initminiupnpc(void)
|
|||
/* initialize Winsock. */
|
||||
WSADATA wsaData;
|
||||
int nResult = WSAStartup(MAKEWORD(2,2), &wsaData);
|
||||
if (nResult != 0)
|
||||
{
|
||||
/* error code could be WSASYSNOTREADY WSASYSNOTREADY
|
||||
* WSASYSNOTREADY WSASYSNOTREADY WSASYSNOTREADY */
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
return 0;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
UPnPType.tp_new = PyType_GenericNew;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue