Thanks Aaron! A different patch was recently submitted for this, but I think perhaps I like yours better. It's a bit simpler.
Would it make sense to test whether fd.revents contains ~(POLLIN|POLLOUT) instead? Jamey On Sat, Jul 10, 2010 at 11:24 PM, Aaron Plattner <[email protected]> wrote: > Fixes the XTS XConnectionNumber test. > > This test creates a display connection, closes its file descriptor, tries to > send a no-op, and then expects an error. XCB just goes into an infinite loop > because poll() returns immediately with POLLNVAL set. > > Signed-off-by: Aaron Plattner <[email protected]> > --- > src/xcb_conn.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/src/xcb_conn.c b/src/xcb_conn.c > index 50a662b..6a07730 100644 > --- a/src/xcb_conn.c > +++ b/src/xcb_conn.c > @@ -337,6 +337,16 @@ int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t > *cond, struct iovec **vec > if(FD_ISSET(c->fd, &wfds)) > #endif > ret = ret && write_vec(c, vector, count); > + > +#if USE_POLL > + if((fd.revents & (POLLERR | > + POLLHUP | > + POLLNVAL))) > + { > + _xcb_conn_shutdown(c); > + ret = 0; > + } > +#endif > } > > if(count) > -- > 1.7.0.4 > > > _______________________________________________ > Xcb mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/xcb > _______________________________________________ [email protected]: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.freedesktop.org/mailman/listinfo/xorg Your subscription address: [email protected]
