summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-03-12 17:38:21 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-03-12 17:38:21 -0700
commit501f4e0ada1690783ada05ad412e4b191ad55336 (patch)
tree9c370d30a1eced57025796b34e75d06f80f88ce9
parent7b9c543e7210c7da204871c31a160e79d3a949b6 (diff)
Bug 6820: Xlib shouldn't handle EAGAIN as a fatal IO error
X.Org Bug #6820 <http://bugs.freedesktop.org/show_bug.cgi?id=6820> Patch #17637 <http://bugs.freedesktop.org/attachment.cgi?id=17637> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--src/XlibInt.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/XlibInt.c b/src/XlibInt.c
index 4159923e..0a0c5371 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -137,11 +137,7 @@ xthread_t (*_Xthread_self_fn)(void) = NULL;
#define ECHECK(err) (errno == err)
#define ESET(val)
#else
-#ifdef ISC
-#define ECHECK(err) ((errno == err) || ETEST())
-#else
#define ECHECK(err) (errno == err)
-#endif
#define ESET(val) errno = val
#endif
#endif
@@ -299,7 +295,7 @@ _XWaitForWritable(
nfound = Select (dpy->fd + 1, &r_mask, &w_mask, NULL, NULL);
#endif
InternalLockDisplay(dpy, cv != NULL);
- if (nfound < 0 && !ECHECK(EINTR))
+ if (nfound < 0 && !(ECHECK(EINTR) || ETEST()))
_XIOError(dpy);
} while (nfound <= 0);
@@ -511,7 +507,7 @@ _XWaitForReadable(
result = Select(highest_fd + 1, &r_mask, NULL, NULL, NULL);
#endif
InternalLockDisplay(dpy, dpy->flags & XlibDisplayReply);
- if (result == -1 && !ECHECK(EINTR)) _XIOError(dpy);
+ if (result == -1 && !(ECHECK(EINTR) || ETEST())) _XIOError(dpy);
if (result <= 0)
continue;
#ifdef USE_POLL
@@ -842,7 +838,7 @@ _XEventsQueued(
if (!pend)
pend = SIZEOF(xReply);
}
- else if (result < 0 && !ECHECK(EINTR))
+ else if (result < 0 && !(ECHECK(EINTR) || ETEST()))
_XIOError(dpy);
}
}