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 *envp[] = { 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,
NULL };
pid_t xkbcomp_pid;
@ -159,7 +159,8 @@ err_dump:
err_xcb:
xcb_disconnect(conn);
err_xvfd:
kill(xvfb_pid, SIGTERM);
if (xvfb_pid > 0)
kill(xvfb_pid, SIGTERM);
err_ctx:
xkb_context_unref(ctx);
return ret;