apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/test testproc.c
Date Mon, 12 Nov 2001 17:44:33 GMT
trawick     01/11/12 09:44:33

  Modified:    test     testproc.c
  Log:
  display the error when pipe-read fails
  
  (it does on Unix right now because of the way the test is written;
  at least the next person won't have to wonder why :) )
  
  Revision  Changes    Path
  1.34      +7 -2      apr/test/testproc.c
  
  Index: testproc.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testproc.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- testproc.c	2001/10/23 17:30:08	1.33
  +++ testproc.c	2001/11/12 17:44:33	1.34
  @@ -78,8 +78,10 @@
       apr_file_t *testfile = NULL;
       apr_size_t length;
       char *buf;
  +    char msgbuf[120];
       const char *args[3];
       char *teststr;
  +    apr_status_t rv;
   
       if (apr_initialize() != APR_SUCCESS){
           printf("Failed to initialize APR\n");
  @@ -131,7 +133,7 @@
       length = 256;
       printf("%-60s", "Checking the data read from pipe to child");
       buf = apr_pcalloc(pool, length);
  -    if (apr_file_read(testfile, buf, &length) == APR_SUCCESS) {
  +    if ((rv = apr_file_read(testfile, buf, &length)) == APR_SUCCESS) {
           if (!strcmp(buf, teststr))
               printf("OK\n");
           else {
  @@ -139,7 +141,10 @@
               printf("  (I actually got %s_\n", buf);
           }
       }
  -    else printf( "Read failed.\n");
  +    else {
  +        printf("Read failed - (%d) %s\n",
  +               rv, apr_strerror(rv, msgbuf, sizeof msgbuf));
  +    }
   
       TEST_NEQ("Waiting for child to die",
                apr_proc_wait(&newproc, NULL, NULL, APR_WAIT),
  
  
  

Mime
View raw message