Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

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 Jun 14, 2019
1 parent 44102a6 commit ce0a7d3
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 @@ -484,7 +484,11 @@ int socket_receive_timeout(int fd, void *data, size_t length, int flags,
return -ECONNRESET;
}
if (result < 0) {
#ifdef WIN32
return -WSAGetLastError();
#else
return -errno;
#endif
}
return result;
}
Expand Down

0 comments on commit ce0a7d3

Please sign in to comment.