From: Luiz Augusto von Dentz Date: Tue, 17 Nov 2020 21:58:37 +0000 (-0800) Subject: test-runner: Move code kill processes created X-Git-Tag: submit/tizen/20220313.220938~554 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f08fd3626ea0c260ba869585e9c94916aef6e66c;p=platform%2Fupstream%2Fbluez.git test-runner: Move code kill processes created This moves the code that kill processes outside of the loop iteration. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/tools/test-runner.c b/tools/test-runner.c index 586152c..f3ad27d 100755 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -735,17 +735,8 @@ start_next: monitor_pid = -1; } - if (corpse == pid) { - if (!run_auto) { - if (daemon_pid > 0) - kill(daemon_pid, SIGTERM); - if (dbus_pid > 0) - kill(dbus_pid, SIGTERM); - if (monitor_pid > 0) - kill(monitor_pid, SIGTERM); - } + if (corpse == pid) break; - } } if (run_auto) { @@ -753,6 +744,15 @@ start_next: goto start_next; } + if (daemon_pid > 0) + kill(daemon_pid, SIGTERM); + + if (dbus_pid > 0) + kill(dbus_pid, SIGTERM); + + if (monitor_pid > 0) + kill(monitor_pid, SIGTERM); + if (serial_fd >= 0) { close(serial_fd); serial_fd = -1;