summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaleb <empty>1995-06-26 20:39:12 +0000
committerkaleb <empty>1995-06-26 20:39:12 +0000
commit84b336fb048e4f16e1f624eca88328020d585972 (patch)
tree26ffe836e6fc42b4e524313d139572f706360d52
parented2ae6c00d3d7dd3283f50bea95a9b17fffc2b56 (diff)
XBUG 7478, do exception events in poll support
-rw-r--r--xc/lib/Xt/NextEvent.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/xc/lib/Xt/NextEvent.c b/xc/lib/Xt/NextEvent.c
index 7a536509a..1949eed59 100644
--- a/xc/lib/Xt/NextEvent.c
+++ b/xc/lib/Xt/NextEvent.c
@@ -1,4 +1,4 @@
-/* $XConsortium: NextEvent.c,v 1.147 95/06/06 21:00:38 kaleb Exp kaleb $ */
+/* $XConsortium: NextEvent.c,v 1.148 95/06/16 19:25:22 kaleb Exp kaleb $ */
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
@@ -237,6 +237,26 @@ static void InitFds (app, ignoreEvents, ignoreInputs, wf)
FD_SET (ConnectionNumber(app->list[ii]), &wf->rmask);
}
#else
+#ifdef POLLRDNORM
+#define XPOLL_READ POLLIN|POLLRDNORM
+#else
+#define XPOLL_READ POLLIN
+#endif
+#ifdef POLLWRNORM
+#if (POLLWRNORM == POLLOUT)
+#define XPOLL_WRITE POLLOUT
+#else
+#define XPOLL_WRITE POLLOUT|POLLWRNORM
+#endif
+#else
+#define XPOLL_WRITE POLLOUT
+#endif
+#ifdef POLLRDBAND
+#define XPOLL_EXCEPT POLLPRI|POLLRDBAND|POLLWRBAND
+#else
+#define XPOLL_EXCEPT POLLPRI
+#endif
+
if (!ignoreEvents)
wf->fdlistlen = wf->num_dpys = app->count;
else
@@ -275,9 +295,11 @@ static void InitFds (app, ignoreEvents, ignoreInputs, wf)
fdlp->events = 0;
for ( ; iep; iep = iep->ie_next) {
if (iep->ie_condition & XtInputReadMask)
- fdlp->events |= POLLIN;
+ fdlp->events |= XPOLL_READ;
if (iep->ie_condition & XtInputWriteMask)
- fdlp->events |= POLLOUT;
+ fdlp->events |= XPOLL_WRITE;
+ if (iep->ie_condition & XtInputExceptMask)
+ fdlp->events |= XPOLL_EXCEPT;
}
fdlp++;
}
@@ -432,23 +454,15 @@ ENDILOOP: ;
for (ii = wf->num_dpys; ii < wf->fdlistlen; ii++, fdlp++) {
condition = 0;
if (fdlp->revents) {
- if (fdlp->revents & (POLLIN|POLLHUP)
+ if (fdlp->revents & (XPOLL_READ|POLLHUP|POLLERR)
#ifdef XTHREADS
&& !(fdlp->revents & POLLNVAL)
#endif
)
condition = XtInputReadMask;
- if (fdlp->revents & POLLOUT
-#ifdef XTHREADS
- && !(fdlp->revents & POLLNVAL)
-#endif
- )
+ if (fdlp->revents & XPOLL_WRITE)
condition |= XtInputWriteMask;
- if (fdlp->revents & POLLERR
-#ifdef XTHREADS
- && !(fdlp->revents & POLLNVAL)
-#endif
- )
+ if (fdlp->revents & XPOLL_EXCEPT)
condition |= XtInputExceptMask;
}
if (condition) {