Index: execunix.c =================================================================== --- execunix.c (revision 39453) +++ execunix.c (working copy) @@ -211,6 +211,17 @@ else dup2(err[1], STDERR_FILENO); + /* Make this process a session leader + * so that when we kill it, all child + * processes of this process are terminated + * as well. + * + * we use kill(-pid, SIGKILL) to kill the + * session leader and all children of this + * session. + */ + setsid(); + execvp( argv[0], argv ); _exit(127); } @@ -367,7 +378,7 @@ struct tms buf; clock_t current = times(&buf); if (globs.timeout <= (current-cmdtab[i].start_time)/tps) { - kill(cmdtab[i].pid, SIGKILL); + kill(-cmdtab[i].pid, SIGKILL); cmdtab[i].exit_reason = EXIT_TIMEOUT; } }