evil: fix initialisation of the socket library.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Vincent Torri 2015-01-28 15:39:44 +01:00 committed by Cedric BAIL
parent 6f7608befd
commit fc81ae40e3
1 changed files with 15 additions and 1 deletions

View File

@ -120,8 +120,22 @@ int
evil_sockets_init(void)
{
WSADATA wsa_data;
WORD version;
return (WSAStartup(MAKEWORD(2, 2), &wsa_data) == 0) ? 1 : 0;
version = MAKEWORD(2, 2);
if (WSAStartup(version, &wsa_data) == 0)
{
if ((LOBYTE(wsa_data.wVersion) == 2) &&
(HIBYTE(wsa_data.wVersion) == 2))
return 1;
else
{
WSACleanup();
return 0;
}
}
return 0;
}
void