diff options
author | Jamey Sharp <jamey@minilop.net> | 2006-09-15 01:09:27 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2006-09-21 15:18:57 -0700 |
commit | 7f71bf9c0f30536e85907b2c991cb7001861e1d3 (patch) | |
tree | d8c3587b5b3851cf9df9b8555e11acd3581d2743 /src/xcb_conn.c | |
parent | 0aa96bfc7abe18889cd85bfaa05b05d53e572bb1 (diff) |
Make all public functions do nothing on an error connection.
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 0176524..2b24dc0 100644 --- a/src/xcb_conn.c +++ b/src/xcb_conn.c @@ -179,12 +179,16 @@ static int write_vec(XCBConnection *c, struct iovec **vector, int *count) const XCBSetup *XCBGetSetup(XCBConnection *c) { + if(c->has_error) + return 0; /* doesn't need locking because it's never written to. */ return c->setup; } int XCBGetFileDescriptor(XCBConnection *c) { + if(c->has_error) + return -1; /* doesn't need locking because it's never written to. */ return c->fd; } @@ -225,7 +229,7 @@ XCBConnection *XCBConnectToFD(int fd, XCBAuthInfo *auth_info) void XCBDisconnect(XCBConnection *c) { - if(!c) + if(c->has_error) return; free(c->setup); |