From 0addc5c63620b5a6c51071947144652794803b96 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 17 Nov 2020 13:58:37 -0800 Subject: [PATCH] test-runner: Move code kill processes created This moves the code that kill processes outside of the loop iteration. --- tools/test-runner.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index ee077ebcf..a17ec594a 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -732,17 +732,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) { @@ -750,6 +741,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; -- 2.47.3