From 66a88ed0e556ca869ddc9df5a35e3d6446d12b02 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 9 Apr 2006 19:19:12 -0700 Subject: Remove unnecessary include. Noticed by jamey. --- src/xcb_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xcb_util.c b/src/xcb_util.c index 93e180c..343e21f 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include -- cgit v1.2.3 From 8275ac3a4a23220b5c3b4f191a45befe2d34d6bd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 9 Apr 2006 19:51:10 -0700 Subject: Retry a select() if it returns with EINTR. Fixes IO errors in Xephyr, which is often interrupted by timers. --- src/xcb_conn.c | 6 +++++- src/xcb_in.c | 4 +++- 2 files changed, 8 insertions(+), 2 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) diff --git a/src/xcb_in.c b/src/xcb_in.c index fa13e90..76f9702 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -229,7 +229,9 @@ static int read_block(const int fd, void *buf, const size_t len) fd_set fds; FD_ZERO(&fds); FD_SET(fd, &fds); - ret = select(fd + 1, &fds, 0, 0, 0); + do { + ret = select(fd + 1, &fds, 0, 0, 0); + } while (ret == -1 && errno == EINTR); } if(ret <= 0) return ret; -- cgit v1.2.3