From f67505c5dfab4ede104e66d949b67cd34f8aa6ba Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 3 Apr 2018 13:34:56 -0700 Subject: [PATCH] test-runner: fix warning in gdb patch --- tools/test-runner.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 659c542d..2848704a 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -1523,7 +1523,7 @@ static void run_py_tests(struct l_settings *hw_settings, struct l_queue *test_stats_queue) { char *argv[3]; - pid_t test_exec_pid, test_timer_pid; + pid_t test_exec_pid, test_timer_pid = -1; struct timeval time_before, time_after, time_elapsed; unsigned int max_exec_interval; char *py_test = NULL; @@ -1575,7 +1575,8 @@ start_next_test: if (test_exec_pid == corpse) { gettimeofday(&time_after, NULL); - kill_process(test_timer_pid); + if (test_timer_pid != -1) + kill_process(test_timer_pid); timersub(&time_after, &time_before, &time_elapsed); interval = time_elapsed.tv_sec +