summaryrefslogtreecommitdiff
path: root/src/xcb_conn.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2006-09-15 01:51:05 -0700
committerJamey Sharp <jamey@minilop.net>2006-09-21 15:35:01 -0700
commit2c8b5994b3fbba343199ef555594a32e29d8bcee (patch)
tree2c10b6567936765119190e429b09fbef650e397c /src/xcb_conn.c
parent79e3227022ae3d66f9f3806d231fdeec2a06cc6b (diff)
Shut down the connection in all "fatal" error cases.
Diffstat (limited to 'src/xcb_conn.c')
-rw-r--r--src/xcb_conn.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index 29d91f4..de1f6e4 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -156,7 +156,10 @@ static int write_vec(XCBConnection *c, struct iovec **vector, int *count)
if(n < 0 && errno == EAGAIN)
return 1;
if(n <= 0)
+ {
+ _xcb_conn_shutdown(c);
return 0;
+ }
for(; *count; --*count, ++*vector)
{
@@ -280,7 +283,10 @@ int _xcb_conn_wait(XCBConnection *c, pthread_cond_t *cond, struct iovec **vector
ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
} while (ret == -1 && errno == EINTR);
if (ret < 0)
+ {
+ _xcb_conn_shutdown(c);
ret = 0;
+ }
pthread_mutex_lock(&c->iolock);
if(ret)