Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 40214 invoked by uid 500); 16 Jan 2002 22:08:07 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 40199 invoked from network); 16 Jan 2002 22:08:07 -0000 Date: 16 Jan 2002 22:08:06 -0000 Message-ID: <20020116220806.42403.qmail@icarus.apache.org> From: aaron@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/test testshm.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N aaron 02/01/16 14:08:06 Modified: test testshm.c Log: 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. Revision Changes Path 1.2 +11 -3 apr/test/testshm.c Index: testshm.c =================================================================== RCS file: /home/cvs/apr/test/testshm.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- testshm.c 12 Jan 2002 18:32:07 -0000 1.1 +++ testshm.c 16 Jan 2002 22:08:06 -0000 1.2 @@ -216,11 +216,11 @@ } 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 @@ 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,9 +249,17 @@ 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);