From 5d821aed9bfda167761e5535006f380f5e60ba9d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 11 Apr 2017 20:19:15 +0300 Subject: [PATCH] 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 --- test/x11comp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/x11comp.c b/test/x11comp.c index 6df861a..3811e7a 100644 --- a/test/x11comp.c +++ b/test/x11comp.c @@ -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; -- 2.7.4