summaryrefslogtreecommitdiff
path: root/test/testoc.c
diff options
context:
space:
mode:
authorDavid Reid <dreid@apache.org>2000-04-04 22:56:11 +0000
committerDavid Reid <dreid@apache.org>2000-04-04 22:56:11 +0000
commit66d0dea752f85f189839cb7dd1852dc5e1e5ba3f (patch)
tree4e910820a108816408ca59f9d55de111da66aa33 /test/testoc.c
parent7f0ce4416e336aeb0c6419c16db16cfb65f65a12 (diff)
downloadapr-66d0dea752f85f189839cb7dd1852dc5e1e5ba3f.tar.gz
Add the other child stuff to beos, tidy up the test program a little and
get the dso code building again. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@59790 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testoc.c')
-rw-r--r--test/testoc.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/test/testoc.c b/test/testoc.c
index a4a02405e..820685ae0 100644
--- a/test/testoc.c
+++ b/test/testoc.c
@@ -64,13 +64,18 @@
void ocmaint(int reason, void *data)
{
+ fprintf(stdout,"[CHILD] Maintenance routine called....");
+ fflush(stdout);
switch (reason) {
case APR_OC_REASON_DEATH:
- fprintf(stdout, "OC killed... correctly\n");
+ fprintf(stdout, "Died correctly\n");
break;
case APR_OC_REASON_LOST:
+ fprintf(stdout, "APR_OC_REASON_LOST\n");
case APR_OC_REASON_UNWRITABLE:
+ fprintf(stdout, "APR_OC_REASON_UNWRITEABLE\n");
case APR_OC_REASON_RESTART:
+ fprintf(stdout, "APR_OC_REASON_RESTART\n");
fprintf(stdout, "OC maintentance called for reason other than death\n");
break;
}
@@ -104,13 +109,16 @@ int main(int argc, char *argv[])
args[1] = ap_pstrdup(context, "-X");
args[2] = NULL;
- fprintf(stdout, "Creating procattr.......");
+ fprintf(stdout, "[PARENT] Creating procattr.............");
+ fflush(stdout);
if (ap_createprocattr_init(&procattr, context) != APR_SUCCESS) {
fprintf(stderr, "Could not create attr\n");
exit(-1);;
}
+ fprintf(stdout, "OK\n");
- fprintf(stdout, "starting other child.......");
+ fprintf(stdout, "[PARENT] Starting other child..........");
+ fflush(stdout);
if (ap_create_process(&newproc, "../testoc", args, NULL, procattr, context)
!= APR_SUCCESS) {
fprintf(stderr, "error starting other child\n");
@@ -118,10 +126,21 @@ int main(int argc, char *argv[])
}
fprintf(stdout, "OK\n");
- ap_register_other_child(newproc, ocmaint, NULL, -1, context);
- ap_kill(newproc, SIGKILL);
+ ap_register_other_child(newproc, ocmaint, NULL, -1, context);
+ fprintf(stdout, "[PARENT] Sending SIGKILL to child......");
+ fflush(stdout);
+ if (ap_kill(newproc, SIGKILL) != APR_SUCCESS) {
+ fprintf(stderr,"couldn't send the signal!\n");
+ exit(-1);
+ }
+ fprintf(stdout,"OK\n");
+
+ /* allow time for things to settle... */
+ sleep(1);
+
+ fprintf(stdout, "[PARENT] Checking on children..........\n");
check_other_child();
return 1;