Index: src/tryto.c =================================================================== RCS file: /var/lib/cvs/socklog/src/tryto.c,v retrieving revision 1.8 diff -u -r1.8 tryto.c --- src/tryto.c 6 Feb 2005 11:36:50 -0000 1.8 +++ src/tryto.c 14 Feb 2006 12:34:04 -0000 @@ -104,6 +104,7 @@ taia_now(&now); taia_uint(&deadline, timeout); taia_add(&deadline, &now, &deadline); + timeout =0; for (;;) { int iopausefds; @@ -163,16 +164,16 @@ int i; char *s; - if (wait_nohang(&rc) == pid) break; - taia_now(&now); - if ((timeout =taia_less(&deadline, &now))) break; - sig_unblock(sig_child); iopause(x, iopausefds, &deadline, &now); sig_block(sig_child); while (read(selfpipe[0], &ch, 1) == 1) {} + taia_now(&now); + if ((timeout =taia_less(&deadline, &now))) break; + if (wait_nohang(&rc) == pid) break; + r = buffer_feed(&buffer_x); if (r < 0) { if ((errno == error_intr) || (errno == error_again)) continue; @@ -201,6 +202,7 @@ close(cpipe[1]); if (timeout) { + if (wait_nohang(&rc) == pid) break; /* child not finished */ strerr_warn4(WARNING, "child \"", *argv, "\" timed out. sending TERM...", 0);