Use the error code returned by the WSAStartup function.

Unlike the other socket functions, the WSAStartup() function returns the
extended error code directly. A call to the WSAGetLastError() function
is not needed and should not be used.
This commit is contained in:
Jef Driesen 2016-01-21 20:05:42 +01:00
parent 0acdee08a1
commit 4475d69814

View File

@ -90,8 +90,9 @@ irda_socket_open (irda_t **out, dc_context_t *context)
// Initialize the winsock dll.
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD (2, 2);
if (WSAStartup (wVersionRequested, &wsaData) != 0) {
SYSERROR (context, ERRNO);
int rc = WSAStartup (wVersionRequested, &wsaData);
if (rc != 0) {
SYSERROR (context, rc);
goto error_free;
}