Commit c2e16dfd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the vtc subprocess a processgroup leader, and kill the

entire process group on timeout.

This still leaves the case where the process group leader exits
without a timeout but some of its subprocesses failed to stop.

Relevant to: #2469
parent 6db0548e
......@@ -165,7 +165,7 @@ tst_cb(const struct vev *ve, int what)
// printf("CB %p %s %d\n", ve, jp->tst->filename, what);
if (what == 0) {
jp->killed = 1;
AZ(kill(jp->child, SIGKILL)); /* XXX: Timeout */
AZ(kill(-jp->child, SIGKILL)); /* XXX: Timeout */
} else {
assert(what & (EV_RD | EV_HUP));
}
......@@ -298,6 +298,7 @@ start_test(void)
jp->child = fork();
assert(jp->child >= 0);
if (jp->child == 0) {
AZ(setpgrp(getpid(), 0));
VFIL_null_fd(STDIN_FILENO);
assert(dup2(p[1], STDOUT_FILENO) == STDOUT_FILENO);
assert(dup2(p[1], STDERR_FILENO) == STDERR_FILENO);
......
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