diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-01 18:11:21 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-01 18:11:21 -0700 |
commit | 6a829f3183688934c2ef2c3d45e252b8722be93b (patch) | |
tree | 419804277ecea77ac08579688e4d5f474526ec38 /src | |
parent | c4e255dc08c8caee1c0b0bffbe75d5e8a372ee56 (diff) |
Send SIGHUP to server at end of xcb test
Since xcb doesn't actually shut down the socket when an error occurs,
we'd hang until our SIGALRM goes off if we did create an xcb connection
error in our test, so we make sure the server exits when desired.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/xcb_client.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xcb_client.c b/src/xcb_client.c index 460c036..032a13c 100644 --- a/src/xcb_client.c +++ b/src/xcb_client.c @@ -29,6 +29,8 @@ #include <xcb/xcbext.h> #include <assert.h> #include <sys/types.h> +#include <unistd.h> +#include <signal.h> static pid_t server_pid; @@ -87,6 +89,8 @@ xhiv_disconnect(xcb_connection_t *conn, xhiv_connection_error_allowed cea) { } xcb_disconnect(conn); + sleep(1); + kill(server_pid, SIGHUP); waitfor = server_pid; server_pid = -1; return XhivWaitServer(waitfor); |