2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 12:42:11 +00:00

When terminating unix processes I forgot to check for negative

time differences.  This patch only sets the select timeout if
the difference between the requested and consumed time is 
positive.



[SVN r39612]
This commit is contained in:
K. Noel Belcourt
2007-09-29 20:23:29 +00:00
parent bc9cba4741
commit 149d4c2eb3

View File

@@ -380,7 +380,9 @@ void populate_file_descriptors(int *fmax, fd_set *fds)
if (globs.timeout && cmdtab[i].pid) {
clock_t consumed = (current - cmdtab[i].start_time) / tps;
timeout = (globs.timeout - consumed) < timeout ? (globs.timeout - consumed) : timeout;
if (0 <= (globs.timeout - consumed) && ((globs.timeout - consumed) < timeout)) {
timeout = globs.timeout - consumed;
}
if (globs.timeout <= consumed) {
killpg(cmdtab[i].pid, SIGKILL);
cmdtab[i].exit_reason = EXIT_TIMEOUT;