about summary refs log tree commit diff stats
path: root/WWW
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-10-17 21:26:25 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1998-10-17 21:26:25 -0400
commit227916a0760fb81d8dd539790a76bf76eceb8e4e (patch)
tree897052dba6f5691874e9beaa49c96760fe834476 /WWW
parent64c4d93e6c1d2751c8517e10192e585db0cbce82 (diff)
downloadlynx-snapshots-227916a0760fb81d8dd539790a76bf76eceb8e4e.tar.gz
snapshot of project "lynx", label v2-8-1pre_11
Diffstat (limited to 'WWW')
-rw-r--r--WWW/Library/Implementation/HTTCP.c18
1 files changed, 18 insertions, 0 deletions
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.