projects
/
free-sw
/
xcb
/
libxcb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
66a88ed
)
Retry a select() if it returns with EINTR. Fixes IO errors in Xephyr, which is
author
Eric Anholt
<anholt@FreeBSD.org>
Mon, 10 Apr 2006 02:51:10 +0000
(19:51 -0700)
committer
Eric Anholt
<anholt@FreeBSD.org>
Mon, 10 Apr 2006 02:51:10 +0000
(19:51 -0700)
often interrupted by timers.
src/xcb_conn.c
patch
|
blob
|
history
src/xcb_in.c
patch
|
blob
|
history
diff --git
a/src/xcb_conn.c
b/src/xcb_conn.c
index
1e93137
..
95b5fa2
100644
(file)
--- 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
(file)
--- 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;