diff --git a/common/socket.c b/common/socket.c index 2c0c27d..71d4841 100644 --- a/common/socket.c +++ b/common/socket.c @@ -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; }