aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os/io.c')
-rw-r--r--xorg-server/os/io.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index 1303f3ab1..ae3a9a786 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -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