[PATCH i-g-t v2 3/4] runner/executor: Fix error handling at terminating test

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Nov 20 18:32:07 UTC 2024


Instead of just returning and leaking memory and file descriptors
inform user about an error which occurred and terminate
gracefully.

Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 runner/executor.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index a5b5c0eab..5a4c2e1b2 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1533,8 +1533,12 @@ static int monitor_output(pid_t child,
 			}
 
 			killed = next_kill_signal(killed);
-			if (!kill_child(killed, child))
-				return -1;
+			if (!kill_child(killed, child)) {
+				errf("Error at terminating test with %s, errno=%d\n",
+				     killed == SIGQUIT ? "SIGQUIT" : "SIGKILL", errno);
+				killed = -1;
+				break; /* while */
+			}
 			time_killed = time_now;
 		}
 	}
-- 
2.47.0



More information about the igt-dev mailing list