diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-01 17:39:42 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-01 17:41:09 -0700 |
commit | 384a32923590df0b58aa7b862ca894f36e3eb502 (patch) | |
tree | a61cc1c488af80754d627a92db5d61f0e6680a20 | |
parent | 3cb9e7003d72adcff0bd1c9ea3cb3038413c8c09 (diff) |
Allow xcb tests to end with connection errors
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | include/xhiv.h | 9 | ||||
-rw-r--r-- | src/xcb_client.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/include/xhiv.h b/include/xhiv.h index 867258e..9d5cedc 100644 --- a/include/xhiv.h +++ b/include/xhiv.h @@ -66,8 +66,15 @@ extern void XhivSequenceSync(Display *dpy, uint32_t sequence); #ifdef HAVE_XCB /* Manage an xcb display connection to a new Xhiv server */ #include <xcb/xcb.h> + +typedef enum { + xhiv_conn_no_error_allowed = 0, + xhiv_conn_error_allowed +} xhiv_connection_error_allowed; + extern xcb_connection_t *xhiv_connect(xhiv_response *responses); -extern int xhiv_disconnect(xcb_connection_t *conn); +extern int xhiv_disconnect(xcb_connection_t *conn, + xhiv_connection_error_allowed cea); extern void xhiv_sequence_sync(xcb_connection_t *conn, uint32_t sequence); #endif diff --git a/src/xcb_client.c b/src/xcb_client.c index e4f7f33..460c036 100644 --- a/src/xcb_client.c +++ b/src/xcb_client.c @@ -79,10 +79,12 @@ xhiv_sequence_sync(xcb_connection_t *conn, uint32_t seq) { } int -xhiv_disconnect(xcb_connection_t *conn) { +xhiv_disconnect(xcb_connection_t *conn, xhiv_connection_error_allowed cea) { pid_t waitfor; - assert(xcb_connection_has_error(conn) == 0); + if (cea == xhiv_conn_no_error_allowed) { + assert(xcb_connection_has_error(conn) == 0); + } xcb_disconnect(conn); waitfor = server_pid; |