mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 06:18:06 +00:00
Check for when errno is set on windows as well as the windows variant for errors.
This commit is contained in:
parent
88c7720caf
commit
f8b9e41f28
8
util.h
8
util.h
@ -41,17 +41,19 @@
|
|||||||
extern char *WSAErrorMsg(void);
|
extern char *WSAErrorMsg(void);
|
||||||
#define SOCKERRMSG WSAErrorMsg()
|
#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)
|
static inline bool sock_blocks(void)
|
||||||
{
|
{
|
||||||
return (WSAGetLastError() == WSAEWOULDBLOCK);
|
return (WSAGetLastError() == WSAEWOULDBLOCK || errno == EAGAIN);
|
||||||
}
|
}
|
||||||
static inline bool sock_timeout(void)
|
static inline bool sock_timeout(void)
|
||||||
{
|
{
|
||||||
return (WSAGetLastError() == WSAETIMEDOUT);
|
return (WSAGetLastError() == WSAETIMEDOUT || errno == ETIMEDOUT);
|
||||||
}
|
}
|
||||||
static inline bool interrupted(void)
|
static inline bool interrupted(void)
|
||||||
{
|
{
|
||||||
return (WSAGetLastError() == WSAEINTR);
|
return (WSAGetLastError() == WSAEINTR || errno == EINTR);
|
||||||
}
|
}
|
||||||
#ifndef SHUT_RDWR
|
#ifndef SHUT_RDWR
|
||||||
#define SHUT_RDWR SD_BOTH
|
#define SHUT_RDWR SD_BOTH
|
||||||
|
Loading…
Reference in New Issue
Block a user