test/x11comp: be a bit more careful with kill()

We did it correctly but better be safe and appease clang.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2017-04-11 20:19:15 +03:00
parent 9d94145808
commit 5d821aed9b
1 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,7 @@ main(void)
char *original, *dump; char *original, *dump;
char *envp[] = { NULL }; char *envp[] = { NULL };
char *xvfb_argv[] = { "Xvfb", display, NULL }; char *xvfb_argv[] = { "Xvfb", display, NULL };
pid_t xvfb_pid; pid_t xvfb_pid = 0;
char *xkbcomp_argv[] = { "xkbcomp", "-I", NULL /* xkb_path */, display, char *xkbcomp_argv[] = { "xkbcomp", "-I", NULL /* xkb_path */, display,
NULL }; NULL };
pid_t xkbcomp_pid; pid_t xkbcomp_pid;
@ -159,6 +159,7 @@ err_dump:
err_xcb: err_xcb:
xcb_disconnect(conn); xcb_disconnect(conn);
err_xvfd: err_xvfd:
if (xvfb_pid > 0)
kill(xvfb_pid, SIGTERM); kill(xvfb_pid, SIGTERM);
err_ctx: err_ctx:
xkb_context_unref(ctx); xkb_context_unref(ctx);