Commit 4f7d4dca authored by Chris Wilson's avatar Chris Wilson

Use SIGTERM in replace of SIGQUIT

SIGTERM is the normal signal to use when instructing a process to exit.
The only difference is that an unhandled SIGQUIT is meant to generate a
coredump, which is not what we want, but in practice I encountered an
issue where SIGTERM seemed to be deliverable more reliably than SIGQUIT
(in tests using multiple signal helpers).
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 4d4f4b21
......@@ -761,7 +761,7 @@ static void fork_helper_exit_handler(int sig)
/* Someone forgot to fill up the array? */
assert(pid != 0);
ret = kill(pid, SIGQUIT);
ret = kill(pid, SIGTERM);
assert(ret == 0);
while (waitpid(pid, &status, 0) == -1 &&
errno == EINTR)
......@@ -821,13 +821,14 @@ void igt_stop_helper(struct igt_helper_process *proc)
assert(proc->running);
ret = kill(proc->pid,
proc->use_SIGKILL ? SIGKILL : SIGQUIT);
proc->use_SIGKILL ? SIGKILL : SIGTERM);
assert(ret == 0);
while (waitpid(proc->pid, &status, 0) == -1 &&
errno == EINTR)
;
igt_assert(WIFSIGNALED(status) &&
WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGQUIT));
WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM));
proc->running = false;
......@@ -867,7 +868,7 @@ static void children_exit_handler(int sig)
for (int nc = 0; nc < num_test_children; nc++) {
int status = -1;
ret = kill(test_children[nc], SIGQUIT);
ret = kill(test_children[nc], SIGTERM);
assert(ret == 0);
while (waitpid(test_children[nc], &status, 0) == -1 &&
......
......@@ -372,7 +372,7 @@ void igt_waitchildren(void);
/**
* igt_helper_process_t:
* @running: indicates whether the process is currently running
* @use_SIGKILL: whether the helper should be terminated with SIGKILL or SIGQUIT
* @use_SIGKILL: whether the helper should be terminated with SIGKILL or SIGTERM
* @pid: pid of the helper if @running is true
* @id: internal id
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment