Skip to content

Commit

Permalink
use exit status 0 for success in testdir, testoc, and testproc
Browse files Browse the repository at this point in the history
since testoc depends on occhild, build occhild when testoc is built

add some trivial error code display logic to testoc


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62093 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
trawick committed Aug 2, 2001
1 parent c3cb0bd commit 4f625fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS)
testdso@EXEEXT@: testdso.lo mod_test.so $(LOCAL_LIBS)
$(LINK) -export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS)

testoc@EXEEXT@: testoc.lo $(LOCAL_LIBS)
testoc@EXEEXT@: testoc.lo occhild@EXEEXT@ $(LOCAL_LIBS)
$(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS)

occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion test/testdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@ int main(void)
apr_pool_destroy(pool);

printf("\nAll tests passed OK\n");
return 1;
return 0;
}
10 changes: 7 additions & 3 deletions test/testoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ static void ocmaint(int reason, void *data, int status)
int main(int argc, char *argv[])
{
#if APR_HAS_OTHER_CHILD
apr_status_t rv;
apr_pool_t *context;
apr_proc_t newproc;
apr_procattr_t *procattr = NULL;
Expand Down Expand Up @@ -143,8 +144,11 @@ int main(int argc, char *argv[])
fprintf(stdout, "[PARENT] Sending SIGKILL to child......");
fflush(stdout);
apr_sleep(1 * APR_USEC_PER_SEC);
if (apr_proc_kill(&newproc, SIGKILL) != APR_SUCCESS) {
fprintf(stderr,"couldn't send the signal!\n");
if ((rv = apr_proc_kill(&newproc, SIGKILL)) != APR_SUCCESS) {
char msgbuf[120];

fprintf(stderr,"couldn't send the signal: %d/%s!\n",
rv, apr_strerror(rv, msgbuf, sizeof msgbuf));
exit(-1);
}
fprintf(stdout,"OK\n");
Expand All @@ -159,6 +163,6 @@ int main(int argc, char *argv[])
fprintf(stdout, "Other_child is not supported on this platform\n");
#endif

return 1;
return 0;
}

2 changes: 1 addition & 1 deletion test/testproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ int main(int argc, char *argv[])
STD_TEST_NEQ("Removing directory", apr_dir_remove("proctest", pool))

printf("\nTest completed succesfully\n");
return(1);
return 0;
}

0 comments on commit 4f625fc

Please sign in to comment.