diff options
author | aaron <aaron@13f79535-47bb-0310-9956-ffa450edef68> | 2002-01-16 22:08:06 +0000 |
---|---|---|
committer | aaron <aaron@13f79535-47bb-0310-9956-ffa450edef68> | 2002-01-16 22:08:06 +0000 |
commit | 5c522f6e2f5ca196de1f0aee78f905c21f8188e1 (patch) | |
tree | 9c390bed3dc285a2142906446e9cdb4a8c3c6d51 /test/testshm.c | |
parent | 117a1385fbb0791817c8d0eab98a7210264134cc (diff) | |
download | libapr-5c522f6e2f5ca196de1f0aee78f905c21f8188e1.tar.gz |
Fix up some of the status messages.
Detect if either the producer or consumer child processes exited
with non-zero status, which is the basis for the success of the
name-based shm test.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62797 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testshm.c')
-rw-r--r-- | test/testshm.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/testshm.c b/test/testshm.c index 7b50ef594..f13d00dce 100644 --- a/test/testshm.c +++ b/test/testshm.c @@ -216,11 +216,11 @@ static apr_status_t test_named(apr_pool_t *parpool) } fprintf(stdout, "OK\n"); - printf("Non-related Processes Test\n"); + printf("fork()ing and exec()ing children:\n"); pidproducer = fork(); if (pidproducer == 0) { /* child */ /* FIXME: exec a producer */ - printf("starting consumer\n"); + printf("starting consumer.....\n"); if (execlp("testshmconsumer", "testshmconsumer", (char*)0) < 0) { return errno; } @@ -230,7 +230,7 @@ static apr_status_t test_named(apr_pool_t *parpool) pidconsumer = fork(); if (pidconsumer == 0) { /* child */ /* FIXME: exec a producer */ - printf("starting producer\n"); + printf("starting producer.....\n"); if (execlp("testshmproducer", "testshmproducer", (char*)0) < 0) { return errno; } @@ -249,10 +249,18 @@ static apr_status_t test_named(apr_pool_t *parpool) if (waitpid(pidconsumer, &exit_int, 0) < 0) { return errno; } + if (WIFEXITED(exit_int)) { + printf("Producer was unsuccessful.\n"); + return APR_EGENERAL; + } printf("Waiting for consumer to exit.\n"); if (waitpid(pidproducer, &exit_int, 0) < 0) { return errno; } + if (WIFEXITED(exit_int)) { + printf("Consumer was unsuccessful.\n"); + return APR_EGENERAL; + } apr_pool_destroy(pool); |