From ff7fa74dd9fde036f79d02e5810dd5ded98dae59 Mon Sep 17 00:00:00 2001 From: marha Date: Sat, 4 Sep 2010 19:55:34 +0000 Subject: libxcb git update 4/9/2010 --- libxcb/src/xcb_conn.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libxcb') diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c index f0b9dd08c..d8cbcb366 100644 --- a/libxcb/src/xcb_conn.c +++ b/libxcb/src/xcb_conn.c @@ -364,6 +364,13 @@ int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vec do { #if USE_POLL ret = poll(&fd, 1, -1); + /* If poll() returns an event we didn't expect, such as POLLNVAL, treat + * it as if it failed. */ + if(ret >= 0 && (fd.revents & ~fd.events)) + { + ret = -1; + break; + } #else ret = select(c->fd + 1, &rfds, &wfds, 0, 0); #endif -- cgit v1.2.3