diff options
author | Eric Anholt <anholt@FreeBSD.org> | 2006-04-09 19:51:10 -0700 |
---|---|---|
committer | Eric Anholt <anholt@FreeBSD.org> | 2006-04-09 19:51:10 -0700 |
commit | 8275ac3a4a23220b5c3b4f191a45befe2d34d6bd (patch) | |
tree | 6f391da51d188cd521bba7ee04ca87b2c11be4dd /src/xcb_conn.c | |
parent | 66a88ed0e556ca869ddc9df5a35e3d6446d12b02 (diff) |
Retry a select() if it returns with EINTR. Fixes IO errors in Xephyr, which is
often interrupted by timers.
Diffstat (limited to 'src/xcb_conn.c')
-rw-r--r-- | src/xcb_conn.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xcb_conn.c b/src/xcb_conn.c index 1e93137..95b5fa2 100644 --- a/src/xcb_conn.c +++ b/src/xcb_conn.c @@ -253,7 +253,11 @@ int _xcb_conn_wait(XCBConnection *c, pthread_cond_t *cond, struct iovec **vector } pthread_mutex_unlock(&c->iolock); - ret = select(c->fd + 1, &rfds, &wfds, 0, 0) > 0; + do { + ret = select(c->fd + 1, &rfds, &wfds, 0, 0); + } while (ret == -1 && errno == EINTR); + if (ret < 0) + ret = 0; pthread_mutex_lock(&c->iolock); if(ret) |