diff options
-rw-r--r-- | os/io.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -102,12 +102,17 @@ typedef struct _connectionOutput { static ConnectionInputPtr AllocateInputBuffer(void); static ConnectionOutputPtr AllocateOutputBuffer(void); -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX +/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno + * for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ #ifndef WIN32 -#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) -#else /* WIN32 The socket errorcodes differ from the normal errors */ +# if (EAGAIN != EWOULDBLOCK) +# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) +# else +# define ETEST(err) (err == EAGAIN) +# endif +#else /* WIN32 The socket errorcodes differ from the normal errors */ #define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) #endif |