From 227916a0760fb81d8dd539790a76bf76eceb8e4e Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sat, 17 Oct 1998 21:26:25 -0400 Subject: snapshot of project "lynx", label v2-8-1pre_11 --- WWW/Library/Implementation/HTTCP.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'WWW') diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index f83334c7..e94f4f2f 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -453,6 +453,9 @@ PUBLIC int HTParseInet ARGS2( fd_set readfds; struct timeval timeout; int dns_patience = 30; /* how many seconds will we wait for DNS? */ +#ifdef WNOWAIT + int child_exited = 0; +#endif /* ** Reap any children that have terminated since last time @@ -574,11 +577,26 @@ PUBLIC int HTParseInet ARGS2( break; } +#ifdef WNOWAIT + /* + ** Clean up if child exited before & no data received. -BL + */ + if (child_exited) { + waitret = waitpid(fpid, &cst1, WNOHANG); + break; + } + /* + ** If child exited, loop once more looking for data. -BL + */ + if ((waitret = waitpid(fpid, &cst1, WNOHANG | WNOWAIT)) > 0) + child_exited = 1; +#else /* ** End loop if child exited. */ if ((waitret = waitpid(fpid, &cst1, WNOHANG)) > 0) break; +#endif /* ** Abort if interrupt key pressed. -- cgit 1.4.1-2-gfad0