Browse Source

Check for when errno is set on windows as well as the windows variant for errors.

port-ckolivas
Con Kolivas 11 years ago committed by Noel Maersk
parent
commit
f8b9e41f28
  1. 8
      util.h

8
util.h

@ -41,17 +41,19 @@ @@ -41,17 +41,19 @@
extern char *WSAErrorMsg(void);
#define SOCKERRMSG WSAErrorMsg()
/* Check for windows variants of the errors as well as when ming
* decides to wrap the error into the errno equivalent. */
static inline bool sock_blocks(void)
{
return (WSAGetLastError() == WSAEWOULDBLOCK);
return (WSAGetLastError() == WSAEWOULDBLOCK || errno == EAGAIN);
}
static inline bool sock_timeout(void)
{
return (WSAGetLastError() == WSAETIMEDOUT);
return (WSAGetLastError() == WSAETIMEDOUT || errno == ETIMEDOUT);
}
static inline bool interrupted(void)
{
return (WSAGetLastError() == WSAEINTR);
return (WSAGetLastError() == WSAEINTR || errno == EINTR);
}
#ifndef SHUT_RDWR
#define SHUT_RDWR SD_BOTH

Loading…
Cancel
Save