Skip to content

Commit

Permalink
Use WSAGetLastError on Windows instead of errno to get socket error i…
Browse files Browse the repository at this point in the history
…nformation.
  • Loading branch information
qmfrederik committed Oct 22, 2018
1 parent 051b116 commit 9de8c80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,11 @@ int socket_receive_timeout(int fd, void *data, size_t length, int flags,
return -EAGAIN;
}
if (result < 0) {
#ifdef WIN32
return -WSAGetLastError();
#else
return -errno;
#endif
}
return result;
}
Expand Down

0 comments on commit 9de8c80

Please sign in to comment.