rbb 00/12/21 08:44:12
Modified: test testsock.c
Log:
Tighten up the testsock code a bit. This allows the testsock code to
detect the dead child processes on FreeBSD.
Revision Changes Path
1.16 +8 -8 apr/test/testsock.c
Index: testsock.c
===================================================================
RCS file: /home/cvs/apr/test/testsock.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- testsock.c 2000/12/03 18:54:08 1.15
+++ testsock.c 2000/12/21 16:44:12 1.16
@@ -96,18 +96,18 @@
exit(-1);
}
- while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE ||
- (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) {
+ while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE &&
+ (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) {
continue;
}
if (s1 == APR_SUCCESS) {
apr_kill(&proc2, SIGTERM);
- apr_wait_proc(&proc2, APR_WAIT);
+ while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE);
}
else {
apr_kill(&proc1, SIGTERM);
- apr_wait_proc(&proc1, APR_WAIT);
+ while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE);
}
fprintf(stdout, "Network test completed.\n");
@@ -162,18 +162,18 @@
exit(-1);
}
- while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE ||
- (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) {
+ while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) == APR_CHILD_NOTDONE &&
+ (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) == APR_CHILD_NOTDONE) {
continue;
}
if (s1 == APR_SUCCESS) {
apr_kill(&proc2, SIGTERM);
- apr_wait_proc(&proc2, APR_WAIT);
+ while (apr_wait_proc(&proc2, APR_WAIT) == APR_CHILD_NOTDONE);
}
else {
apr_kill(&proc1, SIGTERM);
- apr_wait_proc(&proc1, APR_WAIT);
+ while (apr_wait_proc(&proc1, APR_WAIT) == APR_CHILD_NOTDONE);
}
fprintf(stdout, "Network test completed.\n");